Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Storyboard Conditionally showing Views

I am currently working on a project for the iPad using Storyboards for the 1st time and I am wondering if my approach is the correct way to do this.

The first ViewController in this example is actually a split view controller.

Currently within the iPad app when a user clicks on the Export Features Button I am conditionally requesting the segue based on some code / checks I am running

    [self performSegueWithIdentifier:@"subscribe" sender:self];
    [self performSegueWithIdentifier:@"filterOptions" sender:self];
    [self performSegueWithIdentifier:@"showExportedDoc" sender:self];

However I am not sure if I should have 3 navigation controllers and also when a user clicks on the Buy button in the subscribe View Controller it pushes to the Filter Options View which is actually nested in another Navigation Controller.

Any help / advice on this would be great as I mention I am just not sure if I am following the best approach with this.

Thanks

Storyboard Layout

like image 275
MonkeyBlue Avatar asked Dec 06 '13 00:12

MonkeyBlue


1 Answers

... and also when a user clicks on the Buy button in the subscribe View Controller it pushes to the Filter Options View which is actually nested in another Navigation Controller.

Well, I think you have some misunderstanding here. The fact that the filter options view controller is embedded within a navigation controller in your storyboard doesn't mean that it will be instantiated with the UINavigationController when you're pushing it within the current navigation controller (It will be so though if you connect the segue to the UINavigationController that it's embedded into).

To answer your original question, I don't see right and wrong approach here. It all depends on the structure you would like to have. For me, I guess I would prefer to have only one UINavigationController that manages everything (set it as an initial view controller and embed your home view controller within it). This would provide a more consistent navigation experience to the user, plus more consistent look (navigation bar would be shown from the beginning).

like image 60
Mamouneyya Avatar answered Nov 18 '22 13:11

Mamouneyya