0

I have segued to a view controller which is embedded in a navigation controller for title purposes. I want to remove the button which allows me to go back to the last view controller without having to unembed the navigation controller. How might I do this?

I want to remove the grade button

Nikhil Sridhar
  • 1,670
  • 5
  • 20
  • 39

1 Answers1

0

You can do this by accessing the navigationItem of the UINavigationController, and using the setHidesBackButton(_:animated:) method.

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

You can read about the method in Apple's documentation here: https://developer.apple.com/reference/uikit/uinavigationitem/1624934-sethidesbackbutton

Frederik
  • 384
  • 3
  • 7