Skip to content

Latest commit

 

History

History
27 lines (14 loc) · 2.45 KB

appkit_ui.md

File metadata and controls

27 lines (14 loc) · 2.45 KB

AppKit + macOS UI

A list of system image names that can be used for +[NSImage imageNamed:]

AppKit is Apple's UI framework for building apps for the Mac. It has existed in one form or another for around 30 years and is the basis for many of the concepts and features of UIKit on iOS. Understandably, given its age, it has quite a few quirks and dated features. Some can simply be ignored, such as drawers. Others are still core to how parts of AppKit function, such as NSCell. These features can make AppKit seem daunting and difficult to work with, especially for those who have only known UIKit.

Welcome to the second part of my Appreciating AppKit post. In the previous post I gave an overview of the many views and controls of AppKit that either don't exist or are not as powerful in UIKit. In this post I want to cover some of the more "behind the scenes" aspects of AppKit, things that help your productivity as a developer and can aid in the architecture of your apps.

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.

Apple HIG, developer.apple.com

One of the most impactful changes to AppKit in the forthcoming macOS 14 Sonoma update is a change to the default clipping behavior for views. Apple announced that a long-present internal property, “clipsToBounds”, is now public. In tandem with this change, they are changing the default value for this property to false for apps that link against the macOS 14 SDK.