Last active
April 21, 2017 16:05
-
-
Save ConorBrady/268f5dd9fc91076bce07818c3c63c448 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// With segues | |
override func prepare(for segue: UIStoryboardSegue, sender: Any?) { | |
switch segue.identifier { | |
case .some(“doTheThing”): | |
guard let vc = segue.destination as? ParameterizedViewController else { return } | |
vc.param = sender.param | |
} | |
} | |
// Without segues | |
func doTheThing(param: Parameter) { | |
let vc = ParameterizedViewController(param: param) | |
self.present(vc, animated: true, completion: nil) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment