Brandon
Brandon

Reputation: 2171

Disable TabBar's Back Capability

I have a detail view that has a navigation bar and a tab bar. I can easily hide/disable the back button in the navigation bar, but I need to prevent the user from going back to the list view by pressing the tab bar. Any help would be great!

This is how I am disabling the back button in the navigation bar:

[self.navigationItem setHidesBackButton:TRUE];

Upvotes: 0

Views: 103

Answers (2)

Kyle Fang
Kyle Fang

Reputation: 1199

I'm guess this is how your storyboard looks.

enter image description here

But really, you should do it like this.

enter image description here

Upvotes: 1

Andrew Tetlaw
Andrew Tetlaw

Reputation: 2689

Before the detail view is pushed do this:

detailView.hidesBottomBarWhenPushed = YES;

That way the tab bar will be hidden when the detail view is displayed.

Upvotes: 2

Related Questions