Skip to content

Instantly share code, notes, and snippets.

@ConorBrady
Last active April 21, 2017 16:05
Show Gist options
  • Save ConorBrady/268f5dd9fc91076bce07818c3c63c448 to your computer and use it in GitHub Desktop.
Save ConorBrady/268f5dd9fc91076bce07818c3c63c448 to your computer and use it in GitHub Desktop.
// 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