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.


class NSPopoverTouchBarItem : NSTouchBarItem


Configuring the Collapsed Popover

var collapsedRepresentation: NSView

The view displayed when this item is displayed in its parent bar.

var collapsedRepresentationImage: NSImage?

The image displayed by the button for the default collapsed representation.

var collapsedRepresentationLabel: String

The localized string displayed by the button for the default collapsed representation.

Configuring the Expanded Popover

var popoverTouchBar: NSTouchBar

The bar displayed when this item is "popped."

var showsCloseButton: Bool

A Boolean value that determines whether a close button should be shown on the popover bar.

var pressAndHoldTouchBar: NSTouchBar?

The bar that is displayed when a user press-and-holds on the popover item.

Expanding and Collapsing a Popover

func showPopover(Any?)

Replaces the main bar with this item's popover bar.

func dismissPopover(Any?)

Restores the previously visible main bar.

func makeStandardActivatePopoverGestureRecognizer() -> NSGestureRecognizer

Returns a gesture recognizer, configured to invoke the showPopover(_:) method.

Configuring Bar Customization

var customizationLabel: String!

The user-visible string identifying this item during bar customization.


Inherits From

Conforms To

See Also

Touch Bar Items

class NSTouchBarItem

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

class NSCandidateListTouchBarItem

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

class NSColorPickerTouchBarItem

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

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

class NSGroupTouchBarItem

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

class NSSharingServicePickerTouchBarItem

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

class NSSliderTouchBarItem

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

class NSUserInterfaceCompressionOptions

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

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software