Hide Navigation Controller Back Button iOS 7

Adam Johns picture Adam Johns · Nov 19, 2013 · Viewed 22.7k times · Source

I have tried to hide the back button in my navigation controller by adding the following lines to my viewDidLoad method. Many other previous answers on SO have said this works, so I don't know what my problem is? Maybe something new with iOS 7 / Xcode 5?

self.navigationItem.hidesBackButton = YES;
self.navigationController.navigationItem.hidesBackButton = YES;

Answer

Nattudurai picture Nattudurai · Feb 17, 2014

I too had faced similar issue. This will work only when you have not customized your Navigation bar. Either one of the below one will work.

[self.navigationItem setHidesBackButton:YES animated:YES];   OR
[self.navigationItem setHidesBackButton:YES];

Please check whether your getting "Back" in iOS 7, then the above will work.

Hope this will help you to identify the issue