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
selectedSegmentTintColorbackgroundImage(for:barMetrics:)setBackgroundImage(_:for:barMetrics:)contentPositionAdjustment(forSegmentType:barMetrics:)setContentPositionAdjustment(_:forSegmentType:barMetrics:)UISegmentedControl.SegmentdividerImage(forLeftSegmentState:rightSegmentState:barMetrics:)setDividerImage(_:forLeftSegmentState:rightSegmentState:barMetrics:)titleTextAttributes(for:)