Contents

setTitleTextAttributes(_:for:)

Sets the text attributes of the title for a given control state.

Declaration

func setTitleTextAttributes(_ attributes: [NSAttributedString.Key : Any]?, for state: UIControl.State)

Parameters

  • attributes:

    The text attributes of the title for state.

  • state:

    A control state.

Discussion

The attributes dictionary can specify the font, text color, text shadow color, and text shadow offset for the title in the text attributes dictionary, using the keys in NSAttributedString.Key.

See Also

Customizing appearance