Looking for ios Answers? Try Ask4KnowledgeBase
Looking for ios Keywords? Try Ask4Keywords

iOS Getting the title label


Example

The underlying title label, if one exists, can be fetched using

Swift

var label: UILabel? = button.titleLabel

Objective C

UILabel *label = button.titleLabel;

This can be used to set the font of the title label, for example

Swift

button.titleLabel?.font = UIFont.boldSystemFontOfSize(12)

Objective C

button.titleLabel.font = [UIFont boldSystemFontOfSize:12];