iOS Dynamic Type Handling Preferred Text Size Change Without Notifications on iOS 10


Example

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.

Swift

@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.
}