Question

I intend to do something similar to YouTube's interface which has a side menu displayed when the menu button is pressed, and change the view controller when a different page is pressed.

I have all of my view controllers created in Storyboard but I can't find a way to access those. When I use instance:

[mainStoryboard instantiateViewControllerWithIdentifier:@"MenuController"]

it creates a new MenuController instead of the one that is presented from the Storyboard. I would like to use the existing one. Is there a way to do that or do I have to initialize and setup everything programmatically at startup?

Was it helpful?

Solution

It's not really clear what you're trying to do. You're asking how to access View controllers created by storyboard, but it looks like you already know how to do that. If you instead want to access a MenuController you already created sometime before in the app lifecycle, you can just save it in a property, maybe in the AppDelegate for example, so that you can retrieve it when you need it

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top