user643097
user643097

Reputation: 127

disable double tap on UITabBarItem

Is there a way to disable the double tap on UITabBarItem?

Basically I'm pushing a new view over the log-in page and I don't want to allow the user to be able to go back by tapping the tab twice.

Once the user signed in successfully there is no need for the log-in page anymore.

I do the push like this

VC *somevc = [[VC alloc] initWithNibName:@"VC" bundle:nil];
[self.navigationController pushViewController:somevc animated:YES];
[self.navigationController setNavigationBarHidden:NO];
[seomvc release]; 

thanks

Upvotes: 0

Views: 1005

Answers (1)

Noah Witherspoon
Noah Witherspoon

Reputation: 57149

In your VC class’s -viewDidAppear:animated:, you can do something like this:

[self.navigationController setViewControllers:[NSArray arrayWithObject:self] animated:YES];

and thereby remove the login screen from the navigation stack entirely. Tapping the tab bar icon will still return to the root view controller—that’s expected behavior, and you should avoid disabling it without good reason—but the root view controller will now be your somevc instead of the login page.

Upvotes: 1

Related Questions