iOS 14 adds menu support to UIBarButtonItems. UIDocumentBrowserViewController lets you add bar button items to the navigation bar via the additionalTrailingNavigationBarButtonItems property. However, adding a bar button item with a menu results in a button whose menu can not be activated by a press or click. (FB8339455)
Anyone have a workaround?
Anyone have a workaround?
Code Block language objective-c - (void)viewDidLoad { [super viewDidLoad]; // ... UIMenu *menu = [UIMenu menuWithChildren:[self menuElements]]; self.additionalTrailingNavigationBarButtonItems = @[[[UIBarButtonItem alloc] initWithImage:icon menu:menu]]; }