How to hide 'Back' button on navigation bar on iPhone?

Solution 1:

Objective-C:
self.navigationItem.hidesBackButton = YES;

Swift:
navigationItem.hidesBackButton = true

Solution 2:

The best way is to combine these, so it will hide the back button even if you set it up manually :

self.navigationItem.leftBarButtonItem=nil;
self.navigationItem.hidesBackButton=YES;

Solution 3:

hide back button with bellow code...

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

or

[self.navigationItem setHidesBackButton:YES];

Also if you have custom UINavigationBar then try bellow code

self.navigationItem.leftBarButtonItem = nil;

Solution 4:

In Swift:

Add this to the controller

override func viewDidLoad() {
    super.viewDidLoad()
    self.navigationItem.setHidesBackButton(true, animated: false)
}

Solution 5:

Use the code:

 self.navigationItem.backBarButtonItem=nil;