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

Essentials

Protecting the User’s Privacy

Secure personal data, and respect user preferences for how data is used.

App Structure

App and Environment

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

Documents, Data, and Pasteboard

Organize your app's data and preferences, and share that data on the pasteboard or in 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.

App Extensions

Extend your app's basic functionality to other parts of the system.

User Interface

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

Supporting Continuity Camera in Your Mac App

Incorporate scanned documents and pictures taken with a user's iPhone, iPad, or iPod touch into your Mac app using Continuity Camera.

Views and Controls

Present your content onscreen and define the interactions allowed with that content.

View Management

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

View Layout

Position and size views using a stack view or Auto Layout constraints.

Appearance Customization

Add Dark Mode support to your app, and use appearance proxies to modify your UI.

Animation

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

Windows, Panels, and Screens

Organize your view hierarchies and facilitate their display onscreen.

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.

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.

Gestures

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

Touch Bar

Display interactive content and controls in the Touch Bar.

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.

Deprecated

Avoid using deprecated classes and protocols in your apps.

Deprecated Symbols

Review symbols that are no longer supported, and find the replacements to use instead.

Reference

Enumerations

Enumerations for use with multiple classes.