Tyler Riedal
Tyler Riedal

Reputation: 47

Hiding "Back" button in UITabViewController

My storyboard sequence is as follows:

I would like the back button to appear in LaunchScreenVC and LoginVC/SignUpVC but not Tab1VC and Tab2VC.

I placed [self.tabBarController.navigationItem setHidesBackButton:YES animated:YES]; inside viewWillAppear of Tab1VC and TabVC2 but it had no effect. I read that this code should be called prior to instantiation of the VC but how am I able to do this since I am using storyboards?

Upvotes: 2

Views: 221

Answers (1)

gabbler
gabbler

Reputation: 13766

If you only want to hide the back button, you can do the following, add it to the tabBarController's viewDidLoad method.

self.navigationItem.hidesBackButton = YES;

Upvotes: 4

Related Questions