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.

Declaration

Parameters

tabViewItem

The tab view item to be added.

Discussion

The item is added at the end of the array of tab items, so the new tab appears on the right side of the view. If the delegate supports it, it invokes the delegate’s tabViewDidChangeNumberOfTabViewItems: method.

Availability

Declaration

Discussion

The default value of this property is the message font of default size (see messageFontOfSize:), which is equivalent to the system font of default size. Tab height is adjusted automatically to accommodate a new font size. If the view allows truncating, tab labels are truncated as needed.

Import Statement

Availability

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

Declaration

Swift

var drawsBackground: Bool

Objective-C

@propertyBOOLdrawsBackground

Discussion

When the value of this property is YEStrue, the tab view draws a background color when the its type is NSNoTabsNoBorder, otherwise it does not. If the tab view has a bezeled border or a line border, the appropriate background for that border is used. The default value of this property is YEStrue.

Import Statement

Availability

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

Declaration

Swift

var allowsTruncatedLabels: Bool

Objective-C

@propertyBOOLallowsTruncatedLabels

Discussion

When the value of this property is YEStrue, the tab view allows truncating for labels that don’t fit on a tab, otherwise it does not. The default value is YEStrue. When truncating is allowed, the tab view inserts an ellipsis, if necessary, to fit a label in the tab.