Contents

tabViewItem(for:)

Returns the tab view item for the specified child view controller.

Declaration

func tabViewItem(for viewController: NSViewController) -> NSTabViewItem?

Parameters

  • viewController:

    The child view controller whose tab view item you want.

Return Value

The tab view item associated with the view controller or nil if the view controller is not managed by the tab view controller.

Discussion

This method is a convenient way to map a tab view item to a newly added child view controller. When you add child view controllers using the addChild(_:) method, the tab view automatically controller creates a new tab view item. Use this method to fetch that tab view item and configure it.

See Also

Managing Tab View Items