A proxy for a Safari app extension toolbar item in a Safari window.


class SFSafariToolbarItem : NSObject


Your app extension only uses this object when it wants to explicitly set the toolbar item state. Typically, other state changes occur automatically. Safari calls validateToolbarItem(in:validationHandler:) on your app extension handler when changes, such as navigation to a webpage, could affect the state of the toolbar item.


Controlling Toolbar Items

func setEnabled(Bool, withBadgeText: String?)

Sets the enabled state and the badge text for the toolbar item.

func setBadgeText(String?)

Sets the badge text for the toolbar item.

func setEnabled(Bool)

Sets whether the toolbar item is enabled.

func setImage(NSImage?)

Sets the image displayed in the toolbar button.

Instance Methods


Inherits From

See Also

Contextual Menu and Toolbar Items

About Contextual Menu and Toolbar Item Keys

Learn about adding contextual menu items and toolbar items to a Safari App Extension with information property list keys.

Adjusting Settings for a Toolbar Item

Customize a toolbar item for your Safari App Extension.

Adjusting Settings for Contextual Menu Items

Customize contextual menu items for your Safari App Extension.

class SFSafariExtensionViewController

The view controller for a popover associated with your app extension.