Mac Developer Library


AppKit Framework Reference


Classes   Protocols   Other Reference  

AppKit is a framework containing all the objects you need to implement your graphical, event-driven user interface: windows, panels, buttons, menus, scrollers, and text fields. AppKit 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 number of classes in AppKit may seem daunting at first. However, most AppKit classes are support classes that you use indirectly. You also have the choice at which level you use AppKit:

  • Use Interface Builder to create connections from user interface objects to your application objects. In this case, all you need to do is implement your application classes—implement those action and delegate methods. For example, implement the method that is invoked when the user selects a menu item.

  • Control the user interface programmatically, which requires more familiarity with AppKit classes and protocols. For example, allowing the user to drag an icon from one window to another requires some programming and familiarity with the NSDragging... protocols.

  • Implement your own objects by subclassing NSView or other classes. When subclassing NSView you write your own drawing methods using graphics functions. Subclassing requires a deeper understanding of how AppKit works.

To learn more about AppKit, review the NSApplication, NSWindow, and NSView class specifications, paying close attention to delegate methods. For a deeper understanding of how AppKit works, see the specifications for NSResponder and NSRunLoop (NSRunLoop is in the Foundation framework).

AppKit Classes and Protocols

AppKit is large; it comprises more than 125 classes and protocols. The classes all descend from the Foundation framework’s NSObject class. The following sections briefly describe some of the topics that AppKit addresses through its classes and protocols.

Encapsulating an Application

Every application uses a single instance of NSApplication to control the main event loop, keep track of the application’s windows and menus, distribute events to the appropriate objects (that is, itself or one of its windows), set up autorelease pools, and receive notification of application-level events. An NSApplication object has a delegate (an object that you assign) that is notified when the application starts or terminates, is hidden or activated, should open a file selected by the user, and so forth. By setting the NSApplication object’s delegate and implementing the delegate methods, you customize the behavior of your application without having to subclass NSApplication.

General Event Handling and Drawing

The NSResponder class defines the responder chain, an ordered list of objects that respond to user events. When the user clicks the mouse button or presses a key, an event is generated and passed up the responder chain in search of an object that can “respond” to it. Any object that handles events must inherit from the NSResponder class. The core AppKit classes, NSApplication, NSWindow, and NSView, inherit from NSResponder.

An NSApplication object maintains a list of NSWindow objects—one for each window belonging to the application—and each NSWindow object maintains a hierarchy of NSView objects. The view hierarchy is used for drawing and handling events within a window. An NSWindow object handles window-level events, distributes other events to its views, and provides a drawing area for its views. An NSWindow object also has a delegate allowing you to customize its behavior.

NSView is an abstract class for all objects displayed in a window. All subclasses implement a drawing method using graphics functions; drawRect: is the primary method you override when creating a new NSView subclass.


The NSPanel class is a subclass of NSWindow that you use to display transient, global, or pressing information. For example, you would use an instance of NSPanel, rather than an instance of NSWindow, to display error messages or to query the user for a response to remarkable or unusual circumstances. AppKit implements some common panels for you such as the Save, Open and Print panels, used to save, open, and print documents. Using these panels gives the user a consistent “look and feel” across applications for common operations.

Menus and Cursors

The NSMenu, NSMenuItem, and NSCursor classes define the look and behavior of the menus and cursors that your application displays to the user.

Grouping and Scrolling Views

The NSBox, NSScrollView, and NSSplitView classes provide graphic “accessories” to other view objects or collections of views in windows. With the NSBox class, you can group elements in windows and draw a border around the entire group. The NSSplitView class lets you “stack” views vertically or horizontally, apportioning to each view some amount of a common territory; a sliding control bar lets the user redistribute the territory among views. The NSScrollView class and its helper class, NSClipView, provide a scrolling mechanism as well as the graphic objects that let the user initiate and control a scroll. The NSRulerView class allows you to add a ruler and markers to a scroll view.

Controlling an Application

The NSControl and NSCell classes, and their subclasses, define a common set of user interface objects such as buttons, sliders, and browsers that the user can manipulate graphically to control some aspect of your application. Just what a particular control affects is up to you: When a control is “touched,” it sends an action message to a target object. You typically use Interface Builder to set these targets and actions by Control-dragging from the control object to your application or other object. You can also set targets and actions programmatically.

An NSControl object is associated with one or more NSCell objects that implement the details of drawing and handling events. For example, a button comprises both an NSButton object and an NSButtonCell object. The reason for this separation of functionality is primarily to allow NSCell classes to be reused by NSControl classes. For example, NSMatrix and NSTableView can contain multiple NSCell objects of different types.


The NSTableView class displays data in row and column form. NSTableView is ideal for, but not limited to, displaying database records, where rows correspond to each record and columns contain record attributes. The user can edit individual cells and rearrange the columns. You control the behavior and content of an NSTableView object by setting its delegate and data source objects.

Text and Fonts

The NSTextField class implements a simple editable text field, and the NSTextView class provides more comprehensive editing features for larger text bodies.

NSTextView, a subclass of the abstract NSText class, defines the interface to Cocoa’s extended text system. NSTextView supports rich text, attachments (graphics, file, and other), input management and key binding, and marked text attributes. NSTextView works with the font panel and menu, rulers and paragraph styles, the Services facility (for example, the spell-checking service), and the pasteboard. NSTextView also allows customizing through delegation and notifications—you rarely need to subclass NSTextView. You rarely create instances of NSTextView programmatically either, since objects on Interface Builder’s palettes, such as NSTextField, NSForm, and NSScrollView, already contain NSTextView objects.

It is also possible to do more powerful and more creative text manipulation (such as displaying text in a circle) using NSTextStorage, NSLayoutManager, NSTextContainer, and related classes.

The NSFont and NSFontManager classes encapsulate and manage font families, sizes, and variations. The NSFont class defines a single object for each distinct font; for efficiency, these objects, which can be rather large, are shared by all the objects in your application. The NSFontPanel class defines the font specification panel that’s presented to the user.

Graphics and Color

The classes NSImage and NSImageRep encapsulate graphics data, allowing you to easily and efficiently access images stored in files on the disk and displayed on the screen. NSImageRep subclasses each know how to draw an image from a particular kind of source data. The presentation of an image is greatly influenced by the hardware that it’s displayed on. For example, a particular image may look good on a color monitor, but may be too “rich” for monochrome. Through the image classes, you can group representations of the same image, where each representation fits a specific type of display device—the decision of which representation to use can be left to the NSImage class itself.

Color is supported by the classes NSColor, NSColorPanel, NSColorList, NSColorPicker, and NSColorWell. NSColor supports a rich set of color formats and representations, including custom ones. The other classes are mostly interface classes: They define and present panels and views that allow the user to select and apply colors. For example, the user can drag colors from the color panel to any color well. The NSColorPicking protocol lets you extend the standard color panel.


With very little programming on your part, custom view objects can be dragged and dropped anywhere. Objects become part of this dragging mechanism by conforming to NSDragging... protocols: draggable objects conform to the NSDraggingSource protocol, and destination objects (receivers of a drop) conform to the NSDraggingDestination protocol. AppKit hides all the details of tracking the cursor and displaying the dragged image.


The NSPrinter, NSPrintPanel, NSPageLayout, and NSPrintInfo classes work together to provide the means for printing the information that your application displays in its windows and views. You can also create an EPS representation of an NSView.

Accessing the File System

Use the NSFileWrapper class to create objects that correspond to files or directories on disk. NSFileWrapper will hold the contents of the file in memory so that it can be displayed, changed, or transmitted to another application. It also provides an icon for dragging the file or representing it as an attachment. Or use the NSFileManager class in the Foundation framework to access and enumerate file and directory contents. The NSOpenPanel and NSSavePanel classes also provide a convenient and familiar user interface to the file system.

Sharing Data With Other Applications

The NSPasteboard class defines the pasteboard, a repository for data that’s copied from your application, making this data available to any application that cares to use it. NSPasteboard implements the familiar cut-copy-paste operation. The NSServicesRequest protocol uses the pasteboard to communicate data that’s passed between applications by a registered service.

Checking Spelling

The NSSpellServer class lets you define a spell-checking service and provide it as a service to other applications. To connect your application to a spell-checking service, you use the NSSpellChecker class. The NSIgnoreMisspelledWords and NSChangeSpelling protocols support the spell-checking mechanism.


If an application is to be used in more than one part of the world, its resources may need to be customized, or “localized,” for language, country, or cultural region. For example, an application may need to have separate Japanese, English, French, and German versions of character strings, icons, nib files, or context help. Resource files specific to a particular language are grouped together in a subdirectory of the bundle directory (the directories with the “.lproj” extension). Usually you set up localization resource files using Interface Builder. See the specifications for NSBundle AppKit Additions Reference and NSBundle class for more information on localization (NSBundle is in the Foundation framework).



NSObject is the root class of most Objective-C class hierarchies.


The NSAccessibilityElement class provides the basic infrastructure required to interact with an accessibility client.


An alert appears onscreen either as an app-modal dialog or as a sheet attached to a document window.


An NSAlignmentFeedbackFilter object filters the movement of an object and provides haptic feedback when alignment occurs.


Objects of the NSAnimation class manage the timing and progress of animations in the user interface.


The NSViewAnimation class, a public subclass of NSAnimation, offers a convenient way to animate multiple views and windows.


NSAnimationContext is analogous to CATransaction and are similar in overall concept to NSGraphicsContext.


An NSAppearance object represents a file that specifies a standard appearance that applies to a subset of UI elements in an app.


An NSBezierPath object allows you to create paths using PostScript-style commands.


The NSCell class provides a mechanism for displaying text or images in an NSView object without the overhead of a full NSView subclass.


An NSActionCell defines an active area inside a control (an instance of NSControl or one of its subclasses).


The NSButtonCell class is a subclass of NSActionCell.


NSMenuItemCell is a class that handles the measurement and display of a single menu item in its encompassing frame.


The NSPopUpButtonCell class defines the visual appearance of pop-up buttons that display pop-up or pull-down menus.


An NSDatePickerCell instance controls the behavior of an NSDatePicker control, or of a single date picker cell in a matrix.


The NSFormCell class is used to implement text entry fields in a form.


NSLevelIndicatorCell is a subclass of NSActionCell that provides several level indicator display styles including: capacity, ranking and relevancy.


NSPathCell implements the user interface of an NSPathControl object.


An NSSegmentedCell object implements the appearance and behavior of a horizontal button divided into multiple segments.


An NSSliderCell object controls the appearance and behavior of an NSSlider object, or of a single slider in an NSMatrix object.


An NSStepperCell object controls the appearance and behavior of an NSStepper object.


The NSTextFieldCell class adds to the text display capabilities of the NSCell class by allowing you to set the color of both the text and its background.


NSComboBoxCell is a subclass of NSTextFieldCell used to implement the user interface of “combo boxes” (see NSComboBox for information on how combo boxes look and work).


The NSPathComponentCell class displays a component of a path.


The NSSearchFieldCell class defines the programmatic interface for text fields that are optimized for text-based searches.


NSSecureTextFieldCell works with NSSecureTextField to provide a text field whose value is guarded from user examination.


The NSTableHeaderCell class is used by an NSTableHeaderView instance to draw the content of the column headers.


NSTokenFieldCell is a subclass of NSTextFieldCell that provides tokenized editing of an array of objects similar to the address field in the Mail application.


The NSBrowserCell class is the subclass of NSCell used by default to display data in the columns of an NSBrowser object.


An NSImageCell object displays a single image (encapsulated in an NSImage object) in a frame.


NSTextAttachmentCell implements the functionality of the NSTextAttachmentCell protocol.


The NSCollectionViewLayout class is an abstract base class that you subclass and use to generate layout information for a collection view.


The NSCollectionViewFlowLayout class is a concrete layout object that organizes items into a flexible and configurable grid-like arrangement.


An NSCollectionViewGridLayout object displays a single section of items in a row and column grid layout.


A UICollectionViewTransitionLayout object implements custom behaviors when changing from one layout to another in a collection view.


An NSCollectionViewLayoutAttributes object contains layout-related attributes for an element in a collection view.


An NSCollectionViewLayoutInvalidationContext object identifies the portions of your layout that need to be updated.


An NSCollectionViewFlowLayoutInvalidationContext object identifies the portions of an NSCollectionViewFlowLayout object that need to be updated.


An NSCollectionViewUpdateItem object describes a single change to make to an item in a collection view.


An NSColor object represents a color, which is defined in a color space, each point of which has a set of components (such as red, green, and blue) that uniquely define a color.


An NSColorList object is an ordered list of NSColor objects, identified by keys.


The NSColorPicker class is an abstract superclass that implements the NSColorPickingDefault protocol.


The NSColorSpace class enables the creation of objects representing custom color spaces.


The NSController class is an abstract class that implements the NSEditor and NSEditorRegistration informal protocols required for controller classes.


NSObjectController is a Cocoa bindings-compatible controller class.


NSArrayController is a bindings compatible class that manages a collection of objects.


NSDictionaryController is a bindings compatible class that manages display and editing of the contents of an NSDictionary object.


The NSTreeController is a bindings compatible controller that manages a tree of objects.


NSUserDefaultsController is a Cocoa bindings compatible controller class.


Instances of the NSCursor class manage the appearance of the cursor.


The NSDataAsset class enables you to access an object from a data set type stored in an asset catalog.



The NSDockTile class lets you customize the visual representation for your application’s miniaturized windows and application icon as they appear in the Dock.


The NSDocument abstract class defines the interface for OS X documents.


The NSPersistentDocument class is a subclass of NSDocument that is designed to easily integrate into the Core Data framework.


An NSDocumentController object manages an application’s documents.


The NSDraggingImageComponent class represents a single object in a dragging item.


The NSDraggingItem class encompasses a single dragged item within an NSDraggingSession instance.


The NSDraggingSession class encompases a drag and drop action and allows modification of the drag while in progress.


An NSEvent object, or simply an event, contains information about an input action such as a mouse click or a key press.


NSFont objects represent fonts to an application, providing access to characteristics of the font and assistance in laying out glyphs relative to one another.


The NSFontCollection class represents a font collection, that is, a group of font descriptors taken together as a single object.


NSMutableFontCollection is a dedicated class that represents a mutable collection of fonts.


NSFontDescriptor objects provide a mechanism to describe a font with a dictionary of attributes.


NSFontManager is the center of activity for the font conversion system.


An NSGestureRecognizer object monitors events and calls its action method when a predefined sequence of events occur.


An NSClickGestureRecognizer object is a discrete gesture recognizer that tracks a specified number of mouse clicks.


An NSMagnificationGestureRecognizer object is a continuous gesture recognizer that tracks a pinch gesture used to magnify content.


An NSPanGestureRecognizer object implements a continuous gesture recognizer for panning (dragging) gestures.


An NSPressGestureRecognizer object is a discrete gesture recognizer that tracks whether the user held a mouse button down for a minimum amount of time before releasing it.


An NSRotationGestureRecognizer object is a continuous gesture recognizer that tracks two trackpad touches moving opposite each other in a circular motion.


An NSGlyphGenerator object performs the initial, nominal glyph generation phase in the layout process.


An NSGlyphInfo object represents a glyph attribute value (NSGlyphInfoAttributeName) in an attributed string (NSAttributedString).


The NSGradient class provides support for drawing gradient fill colors, also known as shadings in Quartz.


The NSGraphicsContext class is the programmatic interface to objects that represent graphics contexts.


An NSHapticFeedbackManager object allows you to access haptic feedback management attributes on a system with a Force Touch trackpad.


The NSHelpManager class provides an approach to displaying online help.


The NSImage class is a high-level interface for manipulating image data.


The NSImageRep class is a semiabstract superclass (“semi” because it has some instance variables and implementation of its own).


The NSBitmapImageRep class renders an image from bitmap data.


An NSCIImageRep object can render an image from a Core Image CIImage instance.


An NSCachedImageRep object store image data in a form that can be readily transferred to the screen.


An NSCustomImageRep object uses a delegate object to render an image.


An NSEPSImageRep object can render an image from encapsulated PostScript (EPS) code.


An NSPDFImageRep object can render an image from a PDF format data stream.


An NSPICTImageRep object renders an image from a PICT format data stream as described in the Carbon QuickDraw Manager documentation.




The NSLayoutAnchor class is a factory class for creating NSLayoutConstraint objects using a fluent API.


The NSLayoutDimension class is a factory class for creating size-based NSLayoutConstraint objects using a fluent API.


The NSLayoutXAxisAnchor class is a factory class for creating horizontal NSLayoutConstraint objects using a fluent interface (an interface designed to produce more readable code).


The NSLayoutYAxisAnchor class is a factory class for creating vertical NSLayoutConstraint objects using a fluent interface (an interface designed to produce more readable code).


A constraint defines a relationship between two user interface objects that must be satisfied by the constraint-based layout system.


The NSLayoutGuide class defines a rectangular area that can interact with Auto Layout.


An NSLayoutManager object coordinates the layout and display of characters held in an NSTextStorage object.


An NSMediaLibraryBrowserController instance configures and displays a Media Library Browser panel.


An NSMenu object manages an application’s menus.


The NSMenuItem class defines objects that are used as command items in menus.



Instances of the NSNib class serve as object wrappers, or containers, for Interface Builder nib files.





All OpenGL calls are rendered into an OpenGL graphics context, which in Cocoa is represented by the NSOpenGLContext class.


The NSOpenGLPixelBuffer class gives Cocoa OpenGL implementations access to accelerated offscreen rendering.


To render with OpenGL into an NSOpenGLContext, you must specify the context’s pixel format.


An NSPDFInfo object stores information associated with the creation of a PDF file, such as its URL, tag names, page orientation, and paper size.


An NSPDFPanel object is used to implement a Save or Export as PDF panel that’s consistent with the OS X user interface.


NSPageLayout is a panel that queries the user for information such as paper type and orientation.


The NSParagraphStyle class and its subclass NSMutableParagraphStyle encapsulate the paragraph or ruler attributes used by the NSAttributedString classes.


The NSMutableParagraphStyle class adds methods to its superclass, NSParagraphStyle, for changing the values of the subattributes in a paragraph style attribute.


NSPasteboard objects transfer data to and from the pasteboard server.


NSPasteboardItem is a generic class to represent an item on a pasteboard.



NSPredicateEditorRowTemplate describes available predicates and how to display them.


Use an NSPressureConfiguration object to configure the behavior and progression of a Force Touch trackpad when it responds to a mouse drag or pressure event sequence.


An NSPrintInfo object stores information that’s used to generate printed output.


An NSPrintOperation object controls operations that generate Encapsulated PostScript (EPS) code, Portable Document Format (PDF) code, or print jobs.


An NSPrintPanel object creates the Print panel used to query the user for information about a print job.


An NSPrinter object describes a printer’s capabilities.


NSResponder is an abstract class that forms the basis of event and command processing in the Application Kit.


An NSApplication object manages an app’s main event loop in addition to resources used by all of that app’s objects.


An NSDrawer object is a user interface element that contains and displays view objects including NSTextView, NSScrollView, NSBrowser, and other classes that inherit from NSView.


The NSPopover class provides a means to display additional content related to existing content on the screen.


An NSView object provides the infrastructure for drawing, printing, and handling events in an app.


The NSBox class implements simple views that can title themselves and draw a border around their content.


An NSClipView holds the document view of an NSScrollView, clipping the document view to its frame, handling the details of scrolling in an efficient manner, and updating the NSScrollView when the document view’s size or position changes.


An NSCollectionView object displays an ordered collection of data items using a customizable layout.


NSControl is an abstract superclass that provides three fundamental features for implementing user interface devices: drawing devices on the screen, responding to user events, and sending action messages.


This class provides a user interface for displaying and selecting items from a list of data or from hierarchically organized lists of data such as directory paths.


NSButton is a subclass of the NSControl class.


The NSPopUpButton class defines objects that implement the pop-up and pull-down menus of the graphical user interface.



An NSColorWell object is an NSControl for selecting and displaying a single color value.


NSDatePicker is a subclass of NSControl that provides a user interface for displaying and editing an NSDate object.


An NSImageView object displays image data from an NSImage object in a frame.


NSLevelIndicator is a subclass of NSControl that displays a value on a linear scale.


NSMatrix is a class used for creating groups of NSCell objects that work together in various ways.


An NSForm object is a vertical matrix of NSFormCell objects to implement the fields.


NSPathControl is a subclass of NSControl that represents a file system path or virtual path.


An NSRuleEditor object is a view that allows the user to visually create and configure a list of options which are expressed by the rule editor as a predicate (see Predicate Programming Guide).


NSPredicateEditor is a subclass of NSRuleEditor that is specialized for editing NSPredicate objects.


An NSScroller object controls scrolling of a document view within the clip view of an NSScrollView instance (or potentially of another kind of container view).


An NSSegmentedControl object implements a linear set of two or more segments, each of which functions as a button.


An NSSlider object displays a range of values for something in the application.


A stepper consists of two small arrows that can increment and decrement a value that appears beside it, such as a date or time.


An NSTableView object displays data for a set of related records, with rows representing individual records and columns representing the attributes of those records.


NSOutlineView is a subclass of NSTableView that uses a row-and-column format to display hierarchical data that can be expanded and collapsed, such as directories and files in a file system.


An NSTextField object is a kind of NSControl that displays text that the user can select or edit and that sends its action message to its target when the user presses the Return key while editing.


An NSComboBox is a kind of control that allows you to enter text directly (as you would with an NSTextField) or click the attached arrow at the right of the combo box and select from a displayed (“pop-up”) list of items.


An NSSearchField object implements a text field control that is optimized for performing text-based searches.


NSSecureTextField is a subclass of NSTextField that hides its text from display or other access via the user interface.


NSTokenField is a subclass of NSTextField that provides tokenized editing similar to the address field in the Mail application.


The NSMenuView class handles the display of menus on the user’s screen.



An NSOpenGLView object maintains an NSOpenGLPixelFormat and NSOpenGLContext object into which OpenGL calls can be rendered.


The NSProgressIndicator class lets an application display a progress indicator to show that a lengthy task is under way.



An NSRulerView displays a ruler and markers above or to the side of an NSScrollView’s document view.


The NSScrollView class is the central coordinator for the Application Kit’s scrolling machinery, composed of this class, and the NSClipView, and NSScroller classes.


A split view manages the dividers and orientation for a split view controller (an instance of the NSSplitViewController class.) By default, dividers are oriented horizontally so that sibling views are arranged vertically, from top to bottom, in the containing split view controller.


A stack view employs Auto Layout (the system’s constraint-based layout feature) to arrange and align an array of views according to your specification.


An NSTabView object provides a convenient way to present information in multiple pages.


The NSTableCellView class is a reusable container view shown for a particular cell in an NSTableView instance that uses rows for content.


An NSTableHeaderView is used by an NSTableView to draw headers over its columns and to handle mouse events in those headers.


The NSTableRowView class is the view shown for a row in an NSTableView.


NSText declares the most general programmatic interface for objects that manage text.


The NSTextView class is the front-end class to the Application Kit’s text system.


NSVisualEffectView provides support for the user interface effects introduced in OS X Yosemite related to translucency, including “vibrant” appearances.


A view controller manages a view, typically loaded from a nib file.


An NSCollectionViewItem object provides the visual representation for a single data element in a collection view.


The NSPageController class is used for controlling swipe navigation and animations between views or view content.


A split view controller manages an array of adjacent child views, and has a split view object for managing dividers between those views.


An NSTabViewController object is a container view controller that manages a tab view interface, which organizes multiple pages of content but displays only one of those pages at a time.


An NSTitlebarAccessoryViewController object manages a custom view—known as an accessory view—in the title bar–toolbar area of a window.


The NSWindow class defines objects (known as windows) that manage and coordinate the windows an application displays on the screen.


The NSPanel class implements a special kind of window (known as a panel), typically performing an auxiliary function.


The NSColorPanel class provides a standard user interface for selecting color in an application.


The NSFontPanel class implements the Font panel—a user interface object that displays a list of available fonts, letting the user preview them and change the font used to display text.


An NSSavePanel object creates and manages a Save panel and allows you to run the panel in a modal loop.


The NSOpenPanel class provides the Open panel for the Cocoa user interface.


An NSWindowController object manages a window, usually a window stored in a nib file.


An NSRulerMarker object displays a symbol on an NSRulerView object, indicating a location for whatever graphics element it represents in the client of the ruler view (for example, a margin or tab setting, or the edges of a graphic on the page).


NSRunningApplication is a class to manipulate and provide information for a single instance of an application.


An NSScreen object describes the attributes of a computer’s monitor, or screen.


An NSShadow object encapsulates the attributes used to create a drop shadow during drawing operations.


The NSSharingService class is used to provide a consistent user experience when sharing items on OS X.


The NSSharingServicePicker class presents a list of sharing services, so that the user can choose a service to share an item.


The NSSound class provides a simple interface for loading and playing audio files.


The NSSpeechRecognizer class is the Cocoa interface to Speech Recognition on OS X.


The NSSpeechSynthesizer class is the Cocoa interface to Speech Synthesis on OS X.


The NSSpellChecker class provides an interface to the Cocoa spell-checking service.



The NSStatusBar class defines an object that manages a collection of NSStatusItem objects displayed within the system-wide menu bar.


The NSStatusItem class represents the individual elements displayed within an NSStatusBar object.


A storyboard encapsulates the design-time view controller and window controller graph represented in an Interface Builder storyboard resource file.


A storyboard segue specifies a transition or containment relationship between two scenes in a storyboard, where a scene is a view controller or a window controller and a storyboard is an instance of the NSStoryboard class.



An NSTabViewItem is a convenient way for presenting information in multiple pages.


The NSTableColumn class stores the display characteristics and identifier for a column in an NSTableView instance.


An NSTableViewRowAction object defines a single action to present when the user swipes horizontally on a table row.


NSTextAlternatives is an immutable value class that stores a list of alternatives for a piece of text and communicates the user’s selection of an alternative via a notification to your app.


NSTextAttachment objects are used by the NSAttributedString class cluster as the values for attachment attributes (stored in the attributed string under the key named NSAttachmentAttributeName).


NSTextBlock objects represent a block of text laid out in a subregion of the text container.


An NSTextTable object represents a text table as a whole.


An NSTextTableBlock object represents a text block that appears as a cell in a text table.


The NSTextContainer class defines a region where text is laid out.


The NSTextFinder class provides an optional search and replace find-bar interface inside a view, usually a scroll view.


An NSTextInputContext object represents the Cocoa text input system.


An NSTextList object represents a section of text that forms a single list.


An NSTextTab object represents a tab in an NSParagraphStyle object, storing an alignment type and location.


NSToolbar and NSToolbarItem provide the mechanism for a titled window to display a toolbar just below its title bar, as shown below:


The NSToolbarItem class defines each item contained within a window’s NSToolbar instance.


NSToolbarItemGroup is a subclass of NSToolbarItem which contains subitems.


An instance of the NSTouch class is a snapshot of a particular touch at an instant in time.


An NSTrackingArea object defines a region of view that generates mouse-tracking and cursor-update events when the mouse is over that region.


NSTreeNode simplifies the creation and management of trees of objects.


NSLayoutManager uses concrete subclasses of this abstract class, NSTypesetter, to perform line layout, which includes word wrapping, hyphenation, and line breaking in either vertical or horizontal rectangles.


NSATSTypesetter is a concrete subclass of NSTypesetter that places glyphs during the text layout process.


An NSWorkspace object responds to app requests to perform a variety of services:


The NSMutableAttributedString class declares additional methods for mutating the content of an attributed string.


The NSTextStorage class defines the fundamental storage mechanism of TextKit.


CAOpenGLLayer provides a layer suitable for rendering OpenGL content.


NSOpenGLLayer is a subclass of CAOpenGLLayer that is suitable for rendering OpenGL into layers.



The NSAccessibility protocol declares the complete list of properties and methods implemented by accessible elements.

NSAccessibility Informal

The NSAccessibility informal protocol defines an old, key-based API.


The NSAccessibilityButton role-based protocol declares the minimum interface required for an accessibility element to act as a button.


The NSAccessibilityCheckBox role-based protocol declares the minimum interface required for an accessibility element to act as a checkbox.


The NSAccessibilityContainsTransientUI protocol should be used in addition to another role-based protocol.


The NSAccessibilityElement role-based protocol declares the minimum interface required to interact with an accessibility client.


The NSAccessibilityGroup role-based protocol declares the minimum interface required to act as a container for other user interface elements.


The NSAccessibilityImage role-based protocol declares the minimum interface required for an accessibility element to act as a image.


The NSAccessibilityLayoutArea role-based protocol declares the minimum interface required for an accessibility element to act as a layout area.


The NSAccessibilityLayoutItem role-based protocol declares the minimum interface required for an accessibility element to act as a layout item.


The NSAccessibilityList role-based protocol declares the minimum interface required for an accessibility element to act as a list view.


The NSAccessibilityNavigableStaticText role-based protocol declares the minimum interface required for an accessibility element to act as navigable static text.


The NSAccessibilityOutline role-based protocol declares the minimum interface required for an accessibility element to act as an outline view.


The NSAccessibilityProgressIndicator role-based protocol declares the minimum interface required for an accessibility element to act as a progress indicator.


The NSAccessibilityRadioButton role-based protocol declares the minimum interface required for an accessibility element to act as a radio button.


The NSAccessibilityRow role-based protocol declares the minimum interface required for an accessibility element to act as a row for a table, list our outline view.


The NSAccessibilitySlider role-based protocol declares the minimum interface required for an accessibility element to act as a slider.


The NSAccessibilityStaticText role-based protocol declares the minimum interface required for an accessibility element to act as static text.


The NSAccessibilityStepper role-based protocol declares the minimum interface required for an accessibility element to act as a stepper.


The NSAccessibilitySwitch role-based protocol declares the minimum interface required for an accessibility element to act as a switch.


The NSAccessibilityTable role-based protocol declares the minimum interface required for an accessibility element to act as a table view.


The NSAlertDelegate protocol defines the optional methods implemented by delegates of NSAlert objects.



The NSAnimatablePropertyContainer protocol defines a way to add animation to an existing class with a minimum of API impact.


The NSAnimationDelegate protocol defines the optional methods implemented by delegates of NSAnimation objects.


Use the NSAppearanceCustomization protocol to get or set the appearance of a view, or to get the appearance that an offscreen view will use when it draws onscreen in the future.


The NSApplicationDelegate protocol defines the methods that may be implemented by delegates of NSApplication objects.


The NSBrowserDelegate protocol defines the method that a delegate of NSBrowser should implement.


This protocol is implemented by objects in the responder chain that can correct a misspelled word.


An object that adopts the NSCollectionViewDataSource protocol provides the information and view objects required by a collection view to present your content.


The NSCollectionViewDelegate protocol defines methods for managing the behavior of a collection view.


The NSCollectionViewDelegateFlowLayout protocol defines methods for providing layout information to an NSCollectionViewFlowLayout object.


The NSCollectionViewElement protocol defines the methods for managing content in a collection view.


Together with the NSColorPickingDefault protocol, NSColorPickingCustom provides a way to add color pickers—custom user interfaces for color selection—to an application’s NSColorPanel instance.


The NSColorPickingDefault protocol, together with the NSColorPickingCustom protocol, provides an interface for adding color pickers—custom user interfaces for color selection—to an application’s NSColorPanel instance.


The NSComboBoxCellDataSource protocol declares the methods that an NSComboBoxCell uses to access the contents of its data source object.


The NSComboBoxDataSource informal protocol declares the methods that an NSComboBox object uses to access the contents of its data source object.


The NSComboBoxDelegate protocol defines the optional methods implemented by delegates of NSComboBox objects.


The NSControlTextEditingDelegate protocol defines the optional methods implemented by delegates of objects that are subclasses of NSControl.


The NSDatePickerCellDelegate protocol defines the optional methods implemented by delegates of NSDatePickerCell objects.


NSDictionaryControllerKeyValuePair is an informal protocol that is implemented by objects returned by the NSDictionaryController method arrangedObjects.


The NSDockTilePlugIn protocol defines the methods implemented by plug-ins that allow an application’s Dock tile to be customized while the application is not running.


The NSDraggingDestination protocol declares methods that the destination object (or recipient) of a dragged image must implement.


The NSDraggingInfo protocol declares methods that supply information about a dragging session.


The NSDraggingSource protocol declares methods that are implemented by the source object in a dragging session.


The NSDrawerDelegate protocol defines the messages sent to delegates of NSDrawer.


The NSEditor informal protocol is implemented by controllers and user interface elements.


The NSEditorRegistration informal protocol is implemented by controllers to provide an interface for a view, the editor, to inform the controller when it has uncommitted changes.


Informal protocol.


The NSGestureRecognizerDelegate protocol implements methods for fine-tuning a gesture recognizer’s behavior.


The NSGlyphStorage protocol defines the methods that a glyph storage object must implement in order to interact properly with NSGlyphGenerator.


The NSHapticFeedbackPerformer protocol defines the methods and constants that a haptic feedback performer implements.


Implement this protocol to have the Ignore button in the Spelling panel function properly.


The NSImageDelegate protocol defines the optional methods implemented by delegates of NSImage objects.




The NSKeyValueBindingCreation informal protocol provides methods to create and remove bindings between view objects and controllers or controllers and model objects.


This protocol defines an optional CALayer delegate method for handling resolution changes, allowing you to manage scale and contents for a layer hosted in a view.


The NSLayoutManagerDelegate protocol defines the optional methods implemented by delegates of NSLayoutManager objects.


The NSMatrixDelegate protocol defines the optional methods implemented by delegates of NSMatrix objects.


The NSMenuDelegate protocol defines the optional methods implemented by delegates of NSMenu objects.


This informal protocol allows your application to update the enabled or disabled status of an NSMenuItem object.


This informal protocol consists of a single method, awakeFromNib.


The NSOpenSavePanelDelegate protocol defines the methods that a delegate of NSOpenPanel or NSSavePanel should implement.


NSOutlineView objects support a data source delegate in addition to the regular delegate object.


The NSOutlineViewDelegate protocol defines the optional methods implemented by delegates of NSOutlineView objects.


The NSPageControllerDelegate protocol allows you to customize the behavior of instances of the NSPageController class.


This protocol is implemented by the data provider of a pasteboard item to provide the data for a particular UTI type.


The NSPasteboardReading protocol specifies the interface for initializing an object from a pasteboard.


The NSPasteboardWriting protocol specifies the interface for retrieving a representation of an object that can be written to a pasteboard.


The NSPathCellDelegate optional protocol enables the delegate of an NSPathCell object to customize the Open panel or pop-up menu of a path whose style is set to NSPathStylePopUp.


The NSPathControlDelegate optional protocol is implemented by the delegate of an NSPathControl object to support dragging to and from the control.


The NSPlaceholders protocol provides an interface that allows an object to register default placeholders that will be displayed for a binding, when no other placeholder has been specified.


The NSPopoverDelegate protocol defines optional methods that can be implemented by an NSPopover delegate class to provide additional or custom functionality.


The NSPrintPanelAccessorizing protocol declares two methods that the NSPrintPanel class uses to get information from a printing accessory controller.


The NSRuleEditorDelegate protocol defines the optional methods implemented by delegates of NSRuleEditor objects.



Implement the methods in the segue performing protocol to mediate a custom segue.


This informal protocol consists of two methods, writeSelectionToPasteboard:types: and readSelectionFromPasteboard:.


The NSSharingServiceDelegate protocol allows customization of the position and animation of the share sheet as well as be notified of the success or failure of the item being shared..


The NSSharingServicePickerDelegate protocol allows customization of the service picker behavior.


The NSSoundDelegate protocol defines the optional methods implemented by delegates of NSSound objects.


The NSSpeechRecognizerDelegate protocol defines the optional methods implemented by delegates of NSSpeechRecognizer objects.


The NSSpeechSynthesizerDelegate protocol defines the optional methods implemented by delegates of NSSpeechSynthesizer objects.


The NSSplitViewDelegate protocol defines the optional methods implemented by delegates of NSSplitView objects.


The NSSpringLoadingDestination protocol declares methods that the destination object (or recipient) of a dragged object can implement to support spring-loading—the act of dragging an object onto a destination object and hovering or force clicking to activate the destination object.


To configure a custom class to respond to a view detaching from, or reattaching to, a stack view (an instance of the NSStackView class), configure the custom class to adopt the NSStackViewDelegate protocol.


The NSTabViewDelegate protocol defines the optional methods implemented by delegates of NSTabView objects.


The NSTableViewDataSource protocol declares the methods that an instance of NSTableView uses to provide the data to a table view and allow editing of the contents of its data source object.


The NSTableViewDelegate protocol defines the optional methods implemented by delegates of NSTableView objects.


The NSTextAttachmentCell protocol declares the interface for objects that draw text attachment icons and handle mouse events on their icons.



The NSTextDelegate protocol defines the optional methods implemented by delegates of NSText objects.


The NSTextFieldDelegate protocol adopts the NSControlTextEditingDelegate protocol and currently does not extend it further.


The NSTextFindBarContainer protocol provides a container in which the find bar is displayed.


The NSTextFinderClient protocol is implemented by objects that wish to support searching using the NSTextFinder class and the in-window text finder bar.


The NSTextInput protocol defines the methods that Cocoa text views must implement in order to interact properly with the text input management system.


The NSTextInputClient protocol defines the methods that Cocoa text views must implement in order to interact properly with the text input management system.


The NSTextLayoutOrientationProvider protocol defines the orientation of text for an object.


The NSTextStorageDelegate protocol defines the optional methods implemented by delegates of NSTextStorage objects.


The NSTextViewDelegate protocol defines the optional methods implemented by delegates of NSTextView objects.


The NSTokenFieldCellDelegate protocol defines the optional methods implemented by delegates of NSTokenFieldCell objects.


The NSTokenFieldDelegate protocol defines the optional methods implemented by delegates of NSTokenField objects.


The NSToolTipOwner informal protocol declares a method that allows an object to dynamically provide the text to a tool tip.


The NSToolbarDelegate protocol defines the optional methods implemented by delegates of NSToolbar objects.


A toolbar item with a valid target and action is enabled by default.


The NSUserInterfaceItemIdentification protocol is used to associate a unique identifier with objects in your user interface.


The NSUserInterfaceItemSearching protocol show an application can implement Spotlight for Help for their own custom help data.


The NSUserInterfaceValidations protocol works with the NSValidatedUserInterfaceItem protocol to allow the target of a user interface element such as a menu item or a toolbar item to decide whether or not the user interface element should be enabled.


The NSValidatedUserInterfaceItem protocol works with the NSUserInterfaceValidations protocol to enable or disable a control automatically, depending on whether any responder in the responder chain can handle the control’s action method.


The view controller presentation animator protocol lets you define animations to play when transitioning between two view controllers.


The NSWindowDelegate protocol defines the methods that a delegate of NSWindow should implement.


The NSWindowRestoration protocol defines the method that restoration classes must implement to handle the recreation of windows.


Category on NSWindow.

Other Reference

NSAppleScript AppKit Additions Reference

AppKit Functions Reference

AppKit Data Types Reference

AppKit Constants Reference