How to modify UIMenu for UIBarButtonItem and UIButton
问题 iOS 14 adds the ability to display menus upon tapping or long pressing a UIBarButtonItem or UIButton, like so: let menu = UIMenu(children: [UIAction(title: "Action", image: nil) { action in //do something }]) button.menu = menu barButtonItem = UIBarButtonItem(title: "Show Menu", image: nil, primaryAction: nil, menu: menu) This most often replaces action sheets ( UIAlertController with actionSheet style). It's really common to have a dynamic action sheet where actions are only included or may