UILabel
, UITextField
, & UITextView
classes have a new property starting from iOS 10 for automatically resizing their font when a user changes their preferred reading size named adjustsFontForContentSizeCategory
.
@IBOutlet var label:UILabel!
if #available(iOS 10.0, *) {
label.adjustsFontForContentSizeCategory = true
} else {
// Observe for UIContentSizeCategoryDidChangeNotification and handle it manually
// since the adjustsFontForContentSizeCategory property isn't available.
}