Useful Information
How to check if a View Controller is Presented Modally or Pushed to Nav Stack
// If this view controller was presented modally (i.e. the first VC in its navigation
// stack is itself), then show the Cancel button
var isPresentedModally {
if ((self.navigationController == nil) ||
(self.navigationController.viewControllers.first == self)) {
return true
}
return false
}How to hide the "Back" button or the default back button text in the nav bar
// Inside MyViewController.viewDidLoad(:).....
backNavButton = UIBarButtonItem(title: "", style: .plain,
target: nil, action: nil)
self.navigationItem.backBarButtonItem = backNavButtonLast updated