Creating a Button with a DropDown Menu in a NSToolbar

Im trying to find an example or documentation for creating a Button with a Dropdown Menu attacted that that you can add to NSToolbar, you can usually see theses types of buttons in a normal mac app, but I just cant find a proper example or documentation on creating such button for mac catalyst


heres an screenshot of my button I want to make a drop down menu button:

Answered by Joshua Jiang in 408086022
Accepted Answer

Hi Ash,


I can't see your screenshot, anyway I did a similar thing using a NSToolbarItemGroup with controlRepresentation = .collapsed

Creating a Button with a DropDown Menu in a NSToolbar
 
 
Q