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]]; }
-
—
purposehood-dev
-
—
sjs
-
—
travis78701
Add a CommentWow, one year later I have the same issue and no reply?
My radar is currently open with less than 10 similar reports. If you haven't done so, could you file a dupe?
There is also a Twitter discussion of https://twitter.com/alexbuga/status/1446480077248770052 in case it helps. In my app, I work around the missing functionality with a one-off vc that creates a menu-like table view.
I've submitted a bug report about this as well.