请告诉我如何自定义此菜单?也许另一种方式来做到这一点?
let barMenu = UIMenu(title: "", children: [
UIAction(title: NSLocalizedString("menu_item_home", comment: "")){
action in
print("menu_item_home 1")
},
UIAction(title: NSLocalizedString("menu_item_settings", comment: "")){
action in
print("menu_item_settings 2")
let settingsStoryboard = UIStoryboard(name: "Settings", bundle: nil)
let settingsController = settingsStoryboard.instantiateViewController(withIdentifier: "SettingsScene") as! SettingsViewController
controller.navigationController?.pushViewController(settingsController, animated: true)
},
UIAction(title: NSLocalizedString("menu_item_contacts", comment: "")){
action in
print("menu_item_contacts 3")
},
])
let navBarMenu = UIBarButtonItem(image: UIImage(systemName: "text.justify"), menu: barMenu)
navigationItem.rightBarButtonItem = navBarMenu
我需要向 NavigationBar 添加一个菜单并自定义它的外观。请指出正确的方向