Sets the title’s text attributes for a given control state.
SDKs
- iOS 5.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
Framework
- UIKit
Declaration
- (void)setTitleTextAttributes:(NSDictionary<NSAttributed String Key, id> *)attributes forState:(UIControl State)state;
Parameters
attributes
A dictionary containing key-value pairs for text attributes.
You can specify the font, text color, text shadow color, and text shadow offset using the keys listed in NSString UIKit Additions Reference.
state
The control state for which you want to set the text attributes for the title.