Last active
January 23, 2016 10:22
-
-
Save TheCodedSelf/6b7b1bf262109cd3341e to your computer and use it in GitHub Desktop.
Miscellaneous
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Random number between 0 and n | |
let n = 42 | |
let randomNumber = Int(arc4random_uniform(n)) | |
// Instantiate a view controller that exists in a storyboard | |
let storyboardName = "Main" | |
let storyboard = UIStoryboard(name: storyboardName, bundle: nil) | |
let storyboardIdForViewController = "MyVC" // Specified in IB on the specific view controller instance | |
let myVc: MyViewController = storyboard.instantiateViewControllerWithIdentifier(storyboardIdForViewController) as! MyViewController |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment