⭐️ This post has been rewritten in December 2021 for Xcode 13 & macOS Monterey. (old version here)
Note (Oct 2023): The names of the buttons have been changed again in the SDK in macOS Sonoma - I will update this post once I have Sonoma on one of my Macs :)
When you’re building a native Mac app and you want it to feel like a part of the system, to have a UI that users who care about design will appreciate, it’s important to use the right kind of controls in the right places. Some features could be implemented visually in a lot of different ways, but only a few of them will “feel right”. This is even more important these days - with the influx of Electron apps that don’t even pretend they’re native, and not always well written Catalyst apps that often feel like something is missing there, an AppKit app written with care and attention to detail stands out from the crowd more than ever.
The macOS SDK has quite a lot of different controls available, and while this gives you a lot of built-in functionality for free, using them in the right way might be a bit more tricky than on iOS. This is especially true in case of the base button class, NSButton
, which lets you choose from as many as 15 different styles, not counting the subclasses.
I originally wrote this post 7 years ago, shortly after OS X 10.10 Yosemite was released, changing the design significantly since the previous versions. The latest version of Xcode was 6.1, and if you were working on a Mac app interface and looked at the selection of available buttons there, you would see something like this: