Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

navigationItem.setHidesBackButton hides the arrow, but the word "Back" remains

Tags:

ios

swift

I need to hide "< Back" button in the navigator controller, but for some reason

self.navigationItem.setHidesBackButton = true

only hides the arrow, the word "Back" remains:

What's the best way to hide navigation back button in iOS8?

Thank you

like image 433
Paul Avatar asked Nov 18 '25 00:11

Paul


1 Answers

You should add this:

    [self.navigationItem setLeftBarButtonItems:nil animated:YES];
    [self.navigationItem setHidesBackButton:YES animated:YES];

In Swift:

    self.navigationItem.setLeftBarButtonItems(nil, animated: true)
    self.navigationItem.setHidesBackButton(true, animated:true)
like image 80
Tariq Avatar answered Nov 19 '25 14:11

Tariq