An NSTabViewItem is a convenient way for presenting information in multiple pages. A tab view is usually distinguished by a row of tabs that give the visual appearance of folder tabs. When the user clicks a tab, the tab view displays a view page provided by your application. A tab view keeps a zero-based array of NSTabViewItems, one for each tab in the view.

Nested Types


These constants describe the current display state of a tab:


Creating a Tab View Item

init(identifier: Any?)

Performs default initialization for the receiver.

Working with Labels

func drawLabel(Bool, in: NSRect)

Draws the receiver’s label in tabRect, which is the area between the curved end caps.

var label: String

Sets the label text for the receiver to label.

func sizeOfLabel(Bool)

Calculates the size of the receiver’s label.

Checking the Tab Display State

var tabState: NSTabState

Returns the current display state of the tab associated with the receiver.

Assigning an Identifier Object

var identifier: Any?

Sets the receiver’s optional identifier object to identifier.

Setting the Color

var color: NSColor

Deprecated. NSTabViewItems use a color supplied by the current theme.

Assigning a View

var view: NSView?

Sets the view associated with the receiver to view.

Setting the Initial First Responder

var initialFirstResponder: NSView?

Sets the initial first responder for the view associated with the receiver (the view that is displayed when a user clicks on the tab) to view.

Accessing the Parent Tab View

var tabView: NSTabView?

Returns the parent tab view for the receiver.

Getting and Setting Tooltips

var toolTip: String?

Sets the tooltip displayed for the tab view item.



These constants describe the current display state of a tab:


Inherits From