SwiftUI Accessibility Dynamic Type

Scale text with Dynamic Type

Allow text to scale across accessibility sizes and preview larger sizes to verify readability.

Example

Demo.swift

ContentView.swift

App.swift

import SwiftUI

struct DynamicTypeDemo: View {
  var body: some View {
VStack(spacing: 8) {
  Text("Title").font(.title)
  Text("Body text that scales with accessibility settings.")
}
.padding()
.dynamicTypeSize(.accessibility2 ... .xxxLarge)
} }

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *