Search code examples
iosios7uiviewcontrolleruinavigationcontrollernavigation

Navigation Stack in IOS7


If I present a controller with a view controller, is it part of the self.navigationcontroller stack?

In essence:

UBSLoginViewController* loginView = [[UBSLoginViewController alloc] initWithNibName:LOGINVIEW bundle:nil];
    UINavigationController* navigation = [[UINavigationController alloc] initWithRootViewController:loginView];
    navigation.navigationBarHidden = YES;
    self.window.rootViewController = navigation;
    [self.window makeKeyAndVisible];
[loginView presentViewController:[[UBSLoadingViewController alloc] initWithNibName:LOADINGVIEW bundle:nil] animated:YES completion:nil];

Is the loading view part of the navigation stack? Essentially, I want to present a modal view that will not be part of the root navigation stack.


Solution

  • If I present a controller with a view controller, is it part of the self.navigationcontroller stack?

    No.

    You need to push the view controller onto your UINavigationController in order for it to be on the navigation controller's stack. Right now you are modally presenting on a view controller which is an entirely different concept.

    Pushing onto a navigation controller looks something like this.

    [self.navigationController pushViewController:loadingViewController animated:YES];