Views and Controls

Present and define the interactions for your content onscreen.

Topics

View Fundamentals

NSView

The infrastructure for drawing, printing, and handling events in an app.

NSControl

A definition of the fundamental behavior for controls, which are specialized views that notify your app of relevant events by using the target-action design pattern.

NSCell

A mechanism for displaying text or images in a view object without the overhead of a full NSView subclass.

NSActionCell

An active area inside a control.

Container Views

Use container views to arrange the views of your interface and to facilitate navigation among those views.

Grid View

Arrange views in a flexible grid, and handle the layout associated with those views.

NSSplitView

A view that arranges two or more views in a linear stack running horizontally or vertically.

NSStackView

A view that arranges an array of views horizontally or vertically and that automatically updates their placement and sizing when the window size changes.

NSTabView

A multipage interface that displays one page at a time.

Scroll View

Provide an interface for navigating content that is too large to fit in the available space.

Content Views

Use content views to organize and display your app's data.

Browser View

Provide a column-based interface for viewing and navigating hierarchical information.

Collection View

Display one or more subviews in a highly configurable arrangement.

Outline View

Display a list-based interface for hierarchical data, where each level of hierarchy is indented from the previous one.

NSOpenGLView

A view that displays OpenGL content in a view.

Deprecated
Table View

Display custom data in rows and columns.

NSTextView

A view that draws text and handles user interactions with that text.

Controls

Use controls to handle specific types of user interactions. Controls are specialized views that use the target-action design pattern to notify your app of interactions with their content.

NSButton

A control that defines an area on the screen that can be used to trigger actions.

NSColorWell

A control that displays a color value and lets the user change that color value.

Date Picker

Display a calendar date and provide controls for editing the date value.

NSImageView

A display of image data from an NSImage object in a frame.

NSLevelIndicator

A visual representation of a level or quantity, using discrete values.

Path Control

A display of a file system path or virtual path information.

NSPopUpButton

A display of a single item from a list of items, and provide an interface for selecting items from the list.

NSProgressIndicator

An interface that provides visual feedback to the user about the status of an ongoing task.

NSRuleEditor

An interface for configuring a rule-based list of options.

NSPredicateEditor

A defined set of rules that allows the editing of predicate objects.

Search Field

Provide a text field that is optimized for text-based search interfaces.

NSSegmentedControl

Display one or more buttons in a single horizontal group.

Slider

Display a range of values from which the user selects a single value.

NSStepper

An interface with up and down arrow buttons for incrementing or decrementing a value.

Text Field

Provide a simple interface for displaying and editing text, including support for password fields and secure forms of text entry.

Token Field

Provide a text field whose text can be rendered in a visually distinct way so that users can recognize portions more easily.

Toolbar

Provide a space for controls under a window's title bar and above your custom content.

Combo Box

Display a list of values in a pop-up menu that lets the user select a value or type in a custom value.

NSMatrix

A legacy interface for grouping radio buttons or other types of cells together.

View Layout

NSLayoutConstraint

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

NSLayoutGuide

A rectangular area that can interact with Auto Layout.

NSLayoutDimension

A factory class for creating size-based layout constraint objects using a fluent API.

NSLayoutAnchor

A factory class for creating layout constraint objects using a fluent API.

NSLayoutXAxisAnchor

A factory class for creating horizontal layout constraint objects using a fluent API.

NSLayoutYAxisAnchor

A factory class for creating vertical layout constraint objects using a fluent API.

NSDictionaryOfVariableBindings

Creates a dictionary wherein the keys are string representations of the corresponding values’ variable names.

NSUserInterfaceCompression

A protocol that describes how a UI control should redisplay when space is restricted.

Visual Adornments

Add purely decorative elements to your user interface.

NSVisualEffectView

A view that adds translucency and vibrancy effects to the views in your interface.

NSBox

A stylized rectangular box with an optional title.

Appearance Customization

Apply standard themes to the views in your interface.

Supporting Dark Mode in Your Interface

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

NSAppearance

An object that manages standard appearance attributes for UI elements in an app.

NSAppearanceCustomization

A set of methods for getting and setting the appearance attributes of a view.

UI Validation

NSUserInterfaceValidations

A protocol that a custom class can adopt to manage the enabled state of a UI element.

NSValidatedUserInterfaceItem

A protocol that a custom class can adopt to manage the automatic enablement of a UI control.

Tool Tips

NSViewToolTipOwner

A set of methods for dynamically associating a tool tip with a view.

See Also

User Interface

Supporting Dark Mode in Your Interface

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

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.

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.