Class

NSTabView

An NSTabView object provides a convenient way to present information in multiple pages. The view contains a row of tabs that give the appearance of folder tabs, as shown in the following figure. The user selects the desired page by clicking the appropriate tab or using the arrow keys to move between pages. Each page displays a view hierarchy provided by your application.

Overview

Symbols

Adding and Removing Tabs

func addTabViewItem(NSTabViewItem)

Adds the specified tab item.

func insertTabViewItem(NSTabViewItem, at: Int)

Inserts the specified item into the tab view’s array of tab view items at the specified index.

func removeTabViewItem(NSTabViewItem)

Removes the specified item from the tab view’s array of tab view items.

Accessing Tabs

func indexOfTabViewItem(NSTabViewItem)

Returns the index of the specified item in the tab view.

func indexOfTabViewItem(withIdentifier: Any)

Returns the index of the item that matches the specified identifier or NSNotFound if the item is not found.

var numberOfTabViewItems: Int

The number of items in the tab view’s array of tab view items.

func tabViewItem(at: Int)

Returns the tab view item at index in the tab view’s array of items.

var tabViewItems: [NSTabViewItem]

The tab view’s array of tab view items.

Selecting a Tab

func selectFirstTabViewItem(Any?)

This action method selects the first tab view item.

func selectLastTabViewItem(Any?)

This action method selects the last tab view item.

func selectNextTabViewItem(Any?)

This action method selects the next tab view item in the sequence.

func selectPreviousTabViewItem(Any?)

This action method selects the previous tab view item in the sequence.

func selectTabViewItem(NSTabViewItem?)

Selects the specified tab view item.

func selectTabViewItem(at: Int)

Selects the tab view item specified by index.

func selectTabViewItem(withIdentifier: Any)

Selects the tab view item specified by identifier.

var selectedTabViewItem: NSTabViewItem?

The tab view item for the currently selected tab.

func takeSelectedTabViewItemFromSender(Any?)

Sets the selected tab view item to the selected item obtained from the sender.

Modifying the Font

var font: NSFont

The font used for the tab view’s label text.

Modifying the Tab Type

var tabViewType: NSTabViewType

The tab type to display the tabs.

Modifying Controls Tint

var controlTint: NSControlTint

The tab view’s control tint.

Manipulating the Background

var drawsBackground: Bool

A Boolean value that indicates if the tab view draws a background color when its type is NSNoTabsNoBorder.

Determining the Size

var minimumSize: NSSize

The minimum size necessary for the tab view to display tabs in a useful way.

var contentRect: NSRect

The rectangle describing the content area of the tab view.

var controlSize: NSControlSize

The size of the tab view.

Truncating Tab Labels

var allowsTruncatedLabels: Bool

A Boolean value that indicates if the tab view allows truncating for labels that don’t fit on a tab.

Assigning a Delegate

var delegate: NSTabViewDelegate?

The tab view’s delegate.

Event Handling

func tabViewItem(at: NSPoint)

Returns the tab view item at the specified point.

Constants

NSTabViewType

These constants specify the tab view’s type as used by the tabViewType property.

NSAppKitVersionNumberWithDirectionalTabs

This constant specifies the minimum version of the Application Kit that supports directional tabs.

Relationships

Inherits From

Conforms To