I've tried a few things to get dropdown menus working on my Catalyst toolbar.
Even tried adding an itemMenuFormRepresentation, but no dice.
Has anyone got this working on Big Sur?
Code Block let barButton = UIBarButtonItem(systemItem: .add, primaryAction: UIAction(title: "Add", handler: { [weak self] _ in ... }), menu: menu) let addItem = NSToolbarItem(itemIdentifier: .addItem, barButtonItem: barButton)
Even tried adding an itemMenuFormRepresentation, but no dice.
Code Block addItem.itemMenuFormRepresentation = AppDelegate.newMenu
Has anyone got this working on Big Sur?
Found a french tweet that I ran through google translate and finally solved this insanity with NSMenuToolbar item. This is actually available in the previous version of catalyst and I had no idea.
Code Block let addItem = NSMenuToolbarItem(itemIdentifier: .addItem) addItem.itemMenu = menu addItem.image = UIImage(systemName: "plus")