Skip to content

rrainn/utilswift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

utilswift

CI Status codecov Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • iOS 8.0+

Installation

utilswift is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'utilswift'

Author

rrainn, Inc., support@rrainn.com

License

utilswift is available under the MIT license. See the LICENSE file for more info.

Documentation

Array

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()!)