Apologies, my original question was misleading. The isHidden / isEnabled flags on the custom bar button item are not really the issue.
The actual problem is the system back button. My view controller is pushed onto an existing navigation stack, so it has a back item. On iOS 26 and earlier, the system back button was suppressed and never appeared. On iOS 27 public beta it now appears at the top-left, which lets the user pop back unexpectedly.
I confirmed that explicitly setting navigationItem.hidesBackButton = true removes it on iOS 27 — that flag is what actually controls the behavior, not the hidden/disabled state of the custom left item.
So my question is really about the system back button: on iOS 26 it was not shown for this pushed view controller, but on iOS 27 it is. Is this an intentional behavior change, or a regression?
class ViewController: UIViewController {
// this is a custom left barbutton in storyboard
@IBOutlet weak var backbutton: UIBarButtonItem!
override func viewDidLoad() {
super.viewDidLoad()
// if not set this flag, behavior is different ios27pb # ios 26
// self.navigationItem.hidesBackButton = true
}
@IBAction func toggleHidden(_ sender: Any) {
backbutton.isEnabled.toggle()
backbutton.isHidden.toggle()
}
@IBAction func tapBack(_ sender: Any) {
self.navigationController?.popViewController(animated: true)
}
}
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: