Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide back button of navigation bar in Story board iOS

I would like to hide back button of navigation bar which is a part of Story board, I have tried different following code snippets in detail view button nothing seems to work for me.

self.navigationItem.hidesBackButton = YES;

self.navigationItem.backBarButtonItem=nil;

PS: I am also having tab bar along with navigation bar in my story board

like image 904
sandy Avatar asked Jan 29 '13 12:01

sandy


2 Answers

Add this line in the viewDidLoad of your ViewController where you would like to hide the back bar button:

[self.navigationItem setHidesBackButton:YES];

Tested successfully in a storyboard project.

like image 76
Niyog Ray Avatar answered Oct 14 '22 13:10

Niyog Ray


Try this

self.navigationItem.hidesBackButton= YES;
like image 41
Meera Avatar answered Oct 14 '22 12:10

Meera