What can you do with the Snippets framework?
Array
extensionsBundle
extensionsData
extensionsDate
extensionsNSError
extensionsNSIndexSet
extensionsNSObject
extensionsNSObject
associated-object extensionsNSObject
weak-reference extensionsNSPredicate
extensionsNSRange
extensionsSelector
extensionsSequence
extensionsSequence
Boolean extensionsString
extensionsTimeInterval
extensionsUIApplication
network activity extensionsUIColor
extensionsUIDevice
extensionsUITableViewController
extensionsUIViewController
extensionsUserDefaults
extensions
See the classes themselves for full details. The following sections provide some usage examples.
[Work in Progress]
Generate a random user: lorem ipsum, but for people.
import Snippets
// Initialise a random-user connection.
let randomUser = RandomUser()
// Generate random user information.
randomUser.get { (randomUser) in
let results = randomUser["results"] as? [NSDictionary]
let nat = results?.first?["nat"] as? String
let info = randomUser["info"] as? NSDictionary
let seed = info?["seed"] as? String
let version = info?["version"] as? String
// Do something with the random-user information.
}
See up-to-date change log here.