Reputation: 1165
I am using Storyboards for a fairly simple MasterDetail app. The Master shows a list of services, which are of different types. Each service-type has its own ViewController. So depending on the type of service selected, I want to segue to a different ViewController. How can I do this?
Upvotes: 0
Views: 991
Reputation: 18290
You can create segues from the master view controller to each of the destinations, and give each of them a semantic identifier (in the inspector panel). Then in some kind of IBAction callback for when an item is pressed in the master, you can call [self performSegueWithIdentifier: passing in the appropriate identifier based on what was pressed.
There are several options for getting this callback to occur, and it depends on the nature of your model and the way you want them displayed. Could be buttons, individual gesture recognizers, or one main gesture recognizer which does some hit-testing to determine what was pressed.
Upvotes: 2