I'm trying to hide the back button when view controller enters the editing mode.
Here's the code
class DetailViewController: BaseViewController {
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
navigationItem.leftBarButtonItem = splitViewController?.displayModeButtonItem()
navigationItem.leftItemsSupplementBackButton = true
}
override func setEditing(editing: Bool, animated: Bool) {
super.setEditing(editing, animated: animated)
navigationItem.setHidesBackButton(editing, animated: animated)
}
}
It works fine in portrait mode. (Sorry for the big images.)
The problem happens in the landscape mode. Every time when it exits from the editing mode, the back button shows up and hides quickly. And the weird thing is the back button is right behind the display mode button.
I'm using Xcode7 beta3 and iOS9 simulator. The sample code "Lister" provided by Apple implements this feature in the same way and works fine, but I can't find any difference. Someone helps?