質問

I have login screen (viewcontroller) and then another signature screen (viewcontroller). Then tabbar controller is presented above signature screen. when the user tap logout button in tabbar controller stack the app should navigate to login screen. I have tried dismissing tabbar controller, but it is not navigating to login screen instead it is navigating to signature screen.

Below is the navigation structure

UINavigationController -- ViewController1 (Login Screen) | --- ViewController2 (Signature Screen) | --- TabbarController (Five Tab Items)

How can i navigate to login screen. Any help is appreciated.

役に立ちましたか?

解決

When the signature view controller presents the tab controller, do this:

[self presentViewController:tabController
                   animated:YES
                 completion:^{
    [self.navigationController popViewControllerAnimated:NO];
}];

Then, when the tab controller is dismissed the login view will already be there waiting.

他のヒント

Try

AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication]delegate];
UINavigationController *navController = (UINavigationController *)appDelegate.window.rootViewController;
[navController popToRootViewControllerAnimated:YES];
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top