Skip to content

Instantly share code, notes, and snippets.

@chelseatroy
Last active January 26, 2017 02:16
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 chelseatroy/58d629204b1f9aab81d8bc04501b00a6 to your computer and use it in GitHub Desktop.
Save chelseatroy/58d629204b1f9aab81d8bc04501b00a6 to your computer and use it in GitHub Desktop.
Passing Information With Segues Example iOS
import UIKit
import FutureKit
class ListOfFruitsViewController: UITableViewController {
...
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if (segue.identifier == "goToFruitDetailsSegue") {
if let
fruitDetailController = segue.destinationViewController as? FruitDetailViewController,
selectedFruit = self.selectedFruit
{
fruitDetailController.fruit = selectedFruit
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment