Framework

AppKit

Construct and manage a graphical, event-driven user interface for your macOS app.

Overview

AppKit contains all the objects you need to implement the user interface for a macOS app—windows, panels, buttons, menus, scrollers, and text fields—and it handles all the details for you as it efficiently draws on the screen, communicates with hardware devices and screen buffers, clears areas of the screen before drawing, and clips views.

The framework also provides APIs you use to make your app accessible to users with disabilities (see Accessibility); to learn more about localizing your app for different languages, countries, or cultural regions, see Internationalization and Localization Guide.

Topics

First Steps

AppKit Release Notes for macOS 10.14

Update your apps to use new features, and test your apps against API changes.

App Structure

Core App

Learn about the objects that you use to interact with the system.

Documents, Files, and iCloud

Manage your app's data using documents and store it to the local file system or to iCloud.

Cocoa Bindings

Automatically synchronize your data model with your app's interface using Cocoa Bindings.

Resource Management

Manage the storyboards and nib files containing your app's user interface, and learn how to load data that is stored in resource files.

User Interface

Your app's user interface provides visual, audible, and tactile feedback to the user about what your app is doing.

Supporting Dark Mode in Your Interface

Adopt a dark appearance in addition to the standard light appearance.

Views and Controls

Present and define the interactions for your content onscreen.

View Management

Manage your user interface, including the size and position of views in a window.

Menus, Cursors, and the Dock

Implement menus and cursors to facilitate interactions with your app, and use your app's Dock tile to convey updated information.

Windows, Panels, and Screens

Organize your view hierarchies and facilitate their display onscreen.

Touch Bar

Display interactive content and controls in the Touch Bar.

Animation

Animate your views and other content to create a more engaging experience for users.

Sound, Speech, and Haptics

Play sounds and haptic feedback, and incorporate speech recognition and synthesis into your interface.

User Interactions

Mouse, Keyboard, and Trackpad

Handle events related to mouse, keyboard, and trackpad input.

Gestures

Encapsulate your app's event-handling logic in gesture recognizers so that you can reuse that code throughout your app.

Drag and Drop

Support the direct manipulation of your app's content using drag and drop.

Accessibility

Make your app more accessible to users with disabilities.

Graphics, Drawing, Color, and Printing

Images and PDF

Create and manage images, in bitmap, PDF, and other formats.

Drawing

Draw shapes, images, and other content on the screen.

Color

Represent colors using built-in or custom formats, and give users options for selecting and applying colors.

Printing

Display the system print panels and manage the printing process.

Text

Text Display

Display text and check spelling.

TextKit

Manage text storage and perform custom layout of text-based content in your app's views.

Fonts

Manage the fonts used to display text.

Quick Actions

Quick Actions allow your app extension to appear in the Finder Preview pane, Quick Actions menu, and Touch Bar.

Property List Key NSExtensionServiceAllowsFinderPreviewItem

A Boolean value indicating whether the extension appears in the Finder Preview pane and Quick Actions menu.

Property List Key NSExtensionServiceFinderPreviewLabel

A name for display when the extension appears in the Finder Preview pane and Quick Actions menu.

Property List Key NSExtensionServiceFinderPreviewIconName

The name of an icon for display when the extension appears in the Finder Preview pane and Quick Actions menu.

Property List Key NSExtensionServiceAllowsTouchBarItem

A Boolean value indicating whether the extension appears as a Quick Action in the Touch Bar.

Property List Key NSExtensionServiceTouchBarLabel

A name for display when the extension appears as a Quick Action in the Touch Bar.

Property List Key NSExtensionServiceTouchBarIconName

The name of an icon for display when the extension appears as a Quick Action in the Touch Bar

Property List Key NSExtensionServiceTouchBarBezelColorName

The color to use for the bezel around the extension when it appears as a Quick Action in the Touch Bar.

Property List Keys

Property List Key APFiles

Describes the files or directories the app installs on the system.

Property List Key APInstallerURL

The base path to the files or directories the app installs.

Property List Key ATSApplicationFontsPath

The location of a font file or directory of fonts in the bundle’s Resources folder.

Property List Key NSDockTilePlugIn

The name of the app's plug-in bundle.

Property List Key NSServices

The services provided by an app.

Property List Key NSSupportsSuddenTermination

A Boolean value indicating whether the system may terminate the app to log out or shut down more quickly.

Reference

Functions

Functions and function-like macros for use with multiple classes.