Views and Controls

Present and define the interactions for your content onscreen.

Topics

First Steps

class NSView

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

class 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.

class NSCell

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

class 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.

class NSSplitView

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

class 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.

class 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.

class NSOpenGLView

A view that displays OpenGL content in a view.

Table View

Display custom data in rows and columns.

class 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.

class NSButton

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

class 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.

class NSImageView

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

class 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.

class NSPopUpButton

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

class NSProgressIndicator

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

class NSRuleEditor

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

class 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.

class 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.

class 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.

class NSMatrix

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

Visual Adornments

Add purely decorative elements to your user interface.

class NSBox

A stylized rectangular box with an optional title.

class NSVisualEffectView

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

View Layout

class NSLayoutConstraint

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

class NSLayoutGuide

A rectangular area that can interact with Auto Layout.

class NSLayoutDimension

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

class NSLayoutAnchor

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

class NSLayoutXAxisAnchor

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

class NSLayoutYAxisAnchor

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

Appearance Customization

Apply standard themes to the views in your interface.

class NSAppearance

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

protocol NSAppearanceCustomization

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

UI Validation

protocol NSUserInterfaceValidations

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

protocol NSValidatedUserInterfaceItem

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

Tool Tips

NSToolTipOwner

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

See Also

User Interface

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.

Accessibility

Make your app more accessible to users with disabilities.

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.

Drag and Drop

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

Sound, Speech, and Haptics

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