Touch Bar

Display interactive content and controls in the Touch Bar.

Topics

First Steps

Integrating a Toolbar and Touch Bar into Your App

Build a toolbar in your app’s window, with a corresponding Touch Bar, for quick access to app features.

Creating and Customizing the Touch Bar

Use and customize your app’s Touch Bar for macOS.

NSTouchBar

An object that provides dynamic contextual controls in the Touch Bar of supported models of MacBook Pro.

NSTouchBarDelegate

A protocol that allows you to provide the items for a bar dynamically.

NSTouchBarProvider

A protocol that an object adopts to create a bar object in your app.

Touch Bar Items

NSTouchBarItem

A UI control shown in the Touch Bar on supported models of MacBook Pro.

NSCandidateListTouchBarItem

A bar item that, along with its delegate, provides a list of textual suggestions for the current text view.

NSColorPickerTouchBarItem

A bar item that provides a system-defined color picker.

NSCustomTouchBarItem

A bar item that contains a responder of your choice, such as a view, a button, or a scrubber (an instance of the NSScrubber class).

NSGroupTouchBarItem

A bar item that provides a bar to contain other items.

NSPopoverTouchBarItem

A bar item that provides a two-state control that can expand into its second state, showing the contents of a bar that it owns.

NSSharingServicePickerTouchBarItem

A bar item that, along with its delegate, provides a list of objects eligible for sharing.

NSSliderTouchBarItem

A bar item that provides a slider control for choosing a value in a range.

NSUserInterfaceCompressionOptions

An object that specifies how user interface elements resize themselves when space is constrained.

Scrubbers

NSScrubber

A customizable item picker control for the Touch Bar.

NSScrubberDataSource

A set of methods that a scrubber data source object implements to provide items to the scrubber from an associated data collection in your app.

NSScrubberDelegate

A set of methods that a scrubber delegate implements to respond to user interactions.

Scrubber Items

NSScrubberItemView

An item at a specific index position in the scrubber.

NSScrubberArrangedView

An abstract base class for the views whose layout is managed by a scrubber.

NSScrubberImageItemView

A concrete view subclass for displaying images in a scrubber items.

NSScrubberSelectionStyle

An abstract class that provides decorative accessory views for selected and highlighted items within a scrubber control.

NSScrubberSelectionView

An abstract base class for specifying the appearance of a highlighted or selected item in a scrubber.

NSScrubberTextItemView

A concrete view subclass for displaying text for an item in a scrubber.

Scrubber Layouts

NSScrubberFlowLayout

A concrete layout object that arranges items end-to-end in a linear strip.

NSScrubberFlowLayoutDelegate

A protocol that a scrubber delegate can adopt to provide the size of an item.

NSScrubberProportionalLayout

A concrete layout object that sizes each item to some fraction of the scrubber's visible size.

NSScrubberLayoutAttributes

The layout of a scrubber item.

NSScrubberLayout

An abstract class that describes the layout of items within a scrubber control.

See Also

User Interface

Supporting Dark Mode in Your Interface

Update colors, images, and behaviors so that your app adapts automatically when Dark Mode is active.

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

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.