SwiftRandom
SwiftRandom is a tiny help suite for generating random data such as
- Random human stuff like: names, gender, titles, tags, conversations
- Random data types like: Int, CGFloat, Bool, UIColor, NSDate, NSURL, element in Array
Usage
Requirements
- Swift version 2.0
Installation
Install via Carthage
- Create a
Cartfile
with the following specification and runcarthage update
.
github "thellimist/SwiftRandom" >= 1.0.0
- Follow the instructions to add the framework to an iOS project.
Install via CocoaPods
You can use CocoaPods to install SwiftRandom
by adding it to your Podfile
:
To download older version you can use
pod 'SwiftRandom', :git => 'https://github.com/thellimist/SwiftRandom.git' #Latest release for Swift 3.0
pod 'SwiftRandom', :git => 'https://github.com/thellimist/SwiftRandom.git', :branch => '2.x' #For Swift 2.3
Install Manually
- Download and drop 'Randoms.swift' in your project.
Improvement
- Feel free adding your own random data functions and sending pull requests.
Possible features:
- Random wildlife pictures (Should not include the image inside project, should load it from web when needed)
- Make OSX compatiable and add here: https://github.com/AndrewSB/awesome-osx
- Random JSON
- Random Gifs (Should not include gifs inside the project, should load it from web when needed)
- Random Videos (Should not include videos inside the project, should load it from web when needed)
- Implement
SwiftRandom
as a protocol any class can conform to (Post.random()
would give you a random post)
License
- SwiftRandom is available under the MIT license. See the LICENSE file.
Keywords
random, swift, data, generator, faker, fake, gravatar