To hide the back button on iOS, we generally write:
self.navigationController?.navigationBar.topItem?.backBarButtonItem = nil
or
self.navigationController?.navigationItem.leftBarButtonItem = nil
or
self.navigationController?.navigationItem.backBarButtonItem = nil
or
self.navigationItem.setHidesBackButton(true, animated: true)
None of the above statements works in my case i.e. iOS 11.4.
Is this any known bug in iOS 11.4 version or I am doing anything wrong?