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

Chilly Zhong picture Chilly Zhong · Mar 5, 2009 · Viewed 180.2k times · Source

I added a navigation control to switch between views in my app. But some of the views shouldn't have 'Back' (the previous title) button. Any ideas about how to hide the back button?

Answer

user8170 picture user8170 · Apr 27, 2009

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

Swift:
navigationItem.hidesBackButton = true