Reputation: 4722
Scenario :
I have five different view controllers and all are having menu button at top left.
I have connected these five menu buttons to same MenuViewController through custom segue using storyboard.
Problem :
Even with current 5 view controller with custom segue attached to MenuViewController storyboard looks super ugly, i tried to arrange them in different ways but there are many other view controllers and other segues around except these 5, which are not letting me make storyboard look clean and have better visibility to see application flow.
There will be more view controllers in future with same type of menu button on top left, and i am currently working on first few screens.
Solutions i know:
Use storyboard method instantiateViewControllerWithIdentifier
to get MenuViewController and show them manually.
Reason i didn't liked it : Custom segue does it in better way with all animation and adding view with view controller code at one place. Here i will need to write button click method in each view controller with custom segue like code to show animation.
Use multiple storyboard with one storybord per module.
Dont know how to use it for this case as all of them are part of same module and i am new to storyboards.
What is best way to handle this case ? is there any better solution which i am missing ? What is clean approach which can achieve this with better visibility of flow of app without much repetition of code etc.
Any help is appreciated.
Upvotes: 2
Views: 519
Reputation: 17622
I think you're just running into the limitations of storyboards in your project. The reason to use a storyboard (as opposed to multiple xib files or doing everything in code) is above all a to easily create and visualize transitions between view controllers (aka segues) at design time. If you have so many segues that they become a tangled mess on the screen, then obviously the storyboard approach is more trouble than it's worth. I would consider breaking it up into xibs, especially if you anticipate your app to get even more complex in the future.
Upvotes: 2
Reputation: 56
[self performSegueWithIdentifier:@"SEGUE_IDENTIFIER" sender:self];
Upvotes: 0