Contents

setButtonType(_:)

Sets the button’s type, which affects its user interface and behavior when clicked.

Declaration

func setButtonType(_ type: NSButton.ButtonType)

Parameters

  • type:

    A constant specifying the type of the button. The available button types are listed under Buttontype in the Nsbuttoncell class.

Discussion

This method causes the button to update to reflect the new type before the method finishes executing.

The types available are for the most common button types, which are also accessible in Interface Builder. You can configure different behavior with the NSButtonCell methods highlightsBy and showsStateBy.

Note that there is no -buttonType method. The set method sets various button properties that together establish the behavior of the type.

See Also

Related Documentation

Configuring buttons