To run the example project, clone the repo, and run pod install
from the Example directory first.
- iOS 8.0+
utilswift is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'utilswift'
rrainn, Inc., support@rrainn.com
utilswift is available under the MIT license. See the LICENSE file for more info.
randomElement
This method returns a randomElement from an array. If array is empty this method will return nil
.
let array: [Int] = [1, 2, 3, 4, 5]
print(array.randomElement()!)