Muhammad Saqib
Muhammad Saqib

Reputation: 991

Pop to Root ViewController in Tab bar Application

I have tabBar Application in which i have added Tab-bar on my SignViewController i have 3 different tabs in my setting Tab i have logOut Button on than button click i want to pop tab bar and jump back to my SignViewController. can any one help in this small issue Please

Upvotes: 0

Views: 1858

Answers (2)

Nilesh Kikani
Nilesh Kikani

Reputation: 2618

I think you need to just understand flow of app what you are doing.

First you are running application using rootviewcontroller.

when you get login success you just assign rootviewcontroller = tabbarcontroller.view, right?

so What you need is that when you want to logout from app then just assign same rootviewto main rootviewcontroller. no need to do any thing.

Or if you are adding as subviews to window then use add and remove methods like

[self.window addSubview:rootview];
[tabbar removefromSuperview];

i hope this will help you.

Upvotes: 1

Swapnil
Swapnil

Reputation: 1878

Use SignviewController as root for navigation. Then you can use method

    [self.navigationController popToRootViewControllerAnimated:YES];
    [self.navigationController popToViewController:signViewController animated:YES];

Upvotes: 0

Related Questions