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.
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
}
}
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
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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.