Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Dynamic Type

Mobile Flock
September 14, 2019

Dynamic Type

A walkthrough to support Dynamic Type in iOS Apps. It's a feature which helps a user to change the system text size according to their preference. For many, it may be just a choice, but for some, it is a necessity.

Mobile Flock

September 14, 2019
Tweet

More Decks by Mobile Flock

Other Decks in Technology

Transcript

  1. Introduction to Dynamic Type TableView and AutoLayout Constraints Supporting Accessibility

    Large Sizes Large Content Viewer Implementation through demo project (s)
  2. Dynamic Type A feature which helps a user to change

    the system text size according to their preference.
  3. Dynamic Type Easier for visually impaired users who need larger

    text for better clarity. Helps users with sharper vision to decrease the text size, accommodating more information on the screen.
  4. guard let customFont = UIFont(name: “CustomFont-abc”, size: UIFont.labelFontSize) else {

    fatalError(“Font NOT found. :((”) } tileLabel.font = UIFontMetrics(forTextStyle: .body).customFont(for: customFont) tileLabel.adjustsFontForContentSizeCategory = true
  5. guard let customFont = UIFont(name: “Avenir-Book”, size: UIFont.labelFontSize) else {

    fatalError(“”) } nameLabel.font = UIFontMetrics(forTextStyle: .headline).customFont(for: customFont) nameLabel.adjustsFontForContentSizeCategory = true
  6. guard let customFont = UIFont(name: “Avenir-Light”, size: UIFont.labelFontSize) else {

    fatalError(“”) } stateLabel.font = UIFontMetrics(forTextStyle: .subheadline).customFont(f or: customFont) stateLabel.adjustsFontForContentSizeCategory = true
  7. let trendsView = UIView() trendsView.showsLargeContentViewer = true trendsView.largeContentTitle = “Trends”

    trendsView.largeContentImage = UIImage(systemName: “arrowTriangle.up.circle”) trendsView.addInteraction(UILargeContentViewerInteraction())