Tutorial by Examples

Swift UIApplication.sharedApplication().preferredContentSizeCategory Objective-C [UIApplication sharedApplication].preferredContentSizeCategory; This returns a content size category constant, or an accessibility content size category constant.
You can register for notifications of when the device text size is changed. Swift NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(updateFont), name: name:UIContentSizeCategoryDidChangeNotification, object: nil) Objective-C [[NSNotificationCenter defaultCenter] addObs...
WKWebView resizes the fonts on web content so that a full-sized web page will fit on the device's form factor. If you want the web text in both portrait and landscape to be similar in size to the user's preferred reading size, you need to set it explicitly. Swift // build HTML header for dynamic t...
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.adju...

Page 1 of 1