简体   繁体   中英

Add UIViewController from another Storyboard

To get more structure in my project I started to use multiple storyboards.

Now I want to push a ViewController from another Storyboard. This works as aspected with no warnings. Unless I open the ViewController for a second time.

The push produces this error message: "nested push animation can result in corrupted navigation bar" and on pop it results in a crash with this message: "Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted."

I push the ViewController with this code: [self.navigationController pushViewController:controller animated:YES];

I assume there is something wrong with the NavigationController.

You should use this : https://github.com/rob-brown/RBStoryboardLink

It enables you to create storyboard links (segues) in your storyboards.

Using this you dont need to use pushViewControllers anymore (which cause your issues). You will be able to use Segues and your life will be much more easier ;)

just in case method for segues :

[self performSegueWithIdentifer:@"MyStoryboard" sender:self];

Enjoy :)

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM