Skip to content

Instantly share code, notes, and snippets.

@codeswimmer
Created December 3, 2011 19:59
Show Gist options
  • Select an option

  • Save codeswimmer/1427977 to your computer and use it in GitHub Desktop.

Select an option

Save codeswimmer/1427977 to your computer and use it in GitHub Desktop.
iOS: segue connection checklist
Here’s a handy checklist for setting up the connections between two scenes:
1. Create a segue from a button or other control on the source scene to the destination scene.*
2. Give the segue a unique Identifier.It only has to be unique in the source scene
different scenes can use the same identifier.
3. Create a delegate protocol for the destination scene.
4. Call the delegate methods from the Cancel and Done buttons**
5. Make the source scene implement the delegate protocol.
It should dismiss the destination view controller when Cancel or Done is touched.
6. Implement prepareForSegue in the source view controller and do destination.
delegate = self;
* If you’re presenting the new screen modally, then often the destination will be a Navigation Controller.
** also at any other point your destination scene needs to communicate with the source scene.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment