John Doe
John Doe

Reputation: 2491

Why does back button not hide in navigation controller?

Code:

self.navigationItem.setHidesBackButton(true, animated: false)

Back button is not getting hidden.

Also tried:

self.navigationController!.navigationItem.setHidesBackButton(true, animated: false)

in the viewDidLoad() method. But it is not working. Why does this not work?

Upvotes: 0

Views: 221

Answers (1)

qtngo
qtngo

Reputation: 1679

Try this, it works for me:

self.navigationItem.leftBarButtonItem = nil
self.navigationItem.setHidesBackButton(true, animated: false)

Hope this helps.

Upvotes: 2

Related Questions