Reputation: 20179
I'm trying to create a dead simple storyboard app with a layout similar to the following. I've got the list/detail view setup but I can't figure out how to link additional pages. I want the "go" page to be my start page and drive off that.
Can someone help me with a dead simple example solution on how you would set this up? I'm trying to use "push" segues.
Upvotes: 0
Views: 397
Reputation: 45500
Here are different ways to create a segues:
1 - From Control To Controller:
2 - Using Connection Inspector
3 - From View Controller to View Controller
add identifier:
Perform the segue:
[self performSegueWithIdentifier:@"yourSegue" sender:sender];
Now here is the thing, this will just perform the segue, if you ever needed to pass some data to that view controller. Then you have to implement the following segue deleguate:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
// Make sure your segue name in storyboard is the same as this line
if ([[segue identifier] isEqualToString:@"yourSegue"])
{
//if you need to pass data to the next controller do it here
}
}
Upvotes: 2
Reputation: 1219
Push segues will not work until you embed your view controller hierarchy in a UINavigationController. You can place one as root view controller for your GO view controller and then it should work
Upvotes: 1
Reputation: 5461
You can do this for example by ctrl click on a button and then move the mouse to your target view controller and release.
I've created a very simple example in my blog:
http://stefansdevplayground.blogspot.de/2014/02/howto-add-view-controllers-to.html
Upvotes: 0