ButtonMadness: Creating and Customizing AppKit Controls

Last Revision:
Version 4.0, 2017-12-21
Upgraded to macOS 10.3 SDK, replaced use of NSMatrix, replaced deprecated APIs.
(Full Revision History)
Build Requirements:
macOS 10.13 SDK
Runtime Requirements:
macOS 10.11 or later

Apple recommends that you design your application with Interface Builder whenever possible. However, you may need to create controls in code when the makeup of your UI is not fully known until runtime. This sample shows both approaches as it gives you an idea of the "magic" that goes on behind the scenes in Interface Builder: creating the standard UI elements, affecting their behavior and attributes, and setting their target/action connections.