How to disable navigation stack menu when long press backBarItem?

I don't want to show navigation stack
  1. not work

Code Block
if #available(iOS 14.0, *) {
      navigationItem.backBarButtonItem?.menu = nil
}
  1. not work either

Code Block
class CustomBackBarButtonItem: UIBarButtonItem {
  @available(iOS 14.0, *)
  override var menu: UIMenu? {
    get {
      return nil
    }
    set { }
  }
}
protocol SetNaviBackBarProtocol {
  func setNavBackItem()
}
extension SetNaviBackBarProtocol where Self: UIViewController {
 
  func setNavBackItem() {
    self.navigationItem.backBarButtonItem = CustomerBackBarButtonItem(title: "", style: .plain, target: self, action: nil)
     
  }
}
class BaseViewController: UIViewController, SetNaviBackBarProtocol {
.....
}


Answered by Eason_Zhang in 648381022
restart Xcode,worked😳
Accepted Answer
restart Xcode,worked😳
How to disable navigation stack menu when long press backBarItem?
 
 
Q