По-человечески не выйдет, нужно две вещи:
1. наследник UIBarButtonItem как новая кнопка назад
2. свой UINavigationController, который имплементит
func navigationController(_ navigationController:, willShow viewController:) из UINavigationControllerDelegate.
В итоге будет что-то вроде такого:
class BackBarButtonItem: UIBarButtonItem {
@available(iOS 14.0, *)
override var menu: UIMenu? {
set {
/* Don't set the menu here */
/*
super.menu = menu */
}
get {
return
super.menu }
}
}
func navigationController(_ navigationController: UINavigationController,
willShow viewController: UIViewController, animated: Bool) {
let backButton = BackBarButtonItem(title: "", style: .plain, target: nil, action: nil)
viewController.navigationItem.backBarButtonItem = backButton
}