Skip to content

Instantly share code, notes, and snippets.

@susieyy
Created January 14, 2017 02:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save susieyy/ae2e6a24f533500d811895d66e1a3532 to your computer and use it in GitHub Desktop.
Save susieyy/ae2e6a24f533500d811895d66e1a3532 to your computer and use it in GitHub Desktop.
#swtws
final class FirstViewController: UIViewController {
func segueToSecondViewController() {
let sender = "This is a second view!"
performSegue(withIdentifier: "SecondViewIdentifier", sender: sender)
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "SecondViewIdentifier" {
let secondViewController = segue.destination as! SecondViewController
secondViewController.titleName = sender as! String
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment