I have added an extension like this:
extension UINavigationController {
@IBInspectable var hideLeftItem: Bool {
get { return self.hideLeftItem }
set {
self.navigationItem.leftBarButtonItem = nil
}
}
}
But it doesn't work when I set it in the identity inspector
. I have tried to set it in the identity inspector
both in the navigation controller
and the navigation bar
as well as the navigation item
itself (but then extending the item instead). If I just set the code straight in viewDidLoad
it works, but I don't want that. What am I missing?