SwiftUI Dynamic Type checklist

A practical SwiftUI Dynamic Type checklist: text styles, scrolling screens, adaptive stacks, sheets and icons, plus how to test at AX3 and AX5.

Picture someone who has set their iPhone to the largest text size because they can't read anything smaller. They open your app. Text ends in "…". A button is pushed off the screen. The page won't scroll. This checklist exists to stop that.

Dynamic Type is the iOS setting that lets people choose their text size. Apps that support it make their text bigger or smaller to match. Below are nine rules for SwiftUI (with UIKit notes), two common traps, and a short way to test.

The numbers you need

Body text on iOS is 17 pt at the default size, which Apple calls Large. The sizes above it, AX1 to AX5, are the "accessibility sizes":

Size Body text Compared with default
Large (default) 17 pt 100%
AX1 28 pt about 165%
AX3 40 pt about 235%
AX5 (largest) 53 pt about 312%

WCAG (the Web Content Accessibility Guidelines, also used for apps) asks that text can grow to 200% without losing content or function. That's success criterion 1.4.4, Resize Text. On iPhone you pass 200% at AX3. So support at least AX3, and test at AX5.

Two more numbers: nothing smaller than 11 pt at the default size, and no Ultralight, Thin or Light weights for text.

The checklist

1. Text uses text styles

A text style is a named role, such as .body or .headline, that iOS sizes for you. Fixed point sizes never scale.

Text("Title").font(.headline)                                                  // scales
Text("Title").font(.custom("Avenir-Heavy", size: 20, relativeTo: .headline))  // custom font that scales
Text("Title").font(.system(size: 20))                                         // never scales

In UIKit, use .preferredFont(forTextStyle:) or UIFontMetrics(forTextStyle:).scaledFont(for:), and set adjustsFontForContentSizeCategory = true. Without it, the font won't update while the app is open.

2. Every screen scrolls

At AX5 in landscape, the screen is only a few lines tall. Anything outside a scroll container is cut off, and nobody can reach it. So put each screen's content in a ScrollView, List or Form, even screens you don't expect to overflow. Add .scrollBounceBehavior(.basedOnSize) (iOS 16.4) so short screens don't bounce.

Content stacked above or below a List in a VStack (a banner, a summary card) doesn't scroll either. Move it into the list, for example as a Section. Scroll in one direction only. WCAG 1.4.10, Reflow, covers this.

3. Side-by-side rows stack at large sizes

Rows such as icon + text, label + value, or two buttons run out of width at large text. Words get squeezed into one-word lines or cut off. The fix is an adaptive stack: an HStack at normal sizes that becomes a VStack at accessibility sizes. Here is a shortened version of the AStack from the free skill (iOS 16 or later):

struct AStack<Content: View>: View {
    @Environment(\.dynamicTypeSize) private var dynamicTypeSize
    var spacing: CGFloat? = nil
    @ViewBuilder var content: Content

    var body: some View {
        let layout = dynamicTypeSize.isAccessibilitySize
            ? AnyLayout(VStackLayout(alignment: .leading, spacing: spacing))
            : AnyLayout(HStackLayout(alignment: .center, spacing: spacing))
        layout { content }
    }
}

Keep pieces that belong together, like an icon and its label, in an inner HStack inside the AStack, so the icon doesn't end up alone on a line. In UIKit, switch UIStackView.axis when preferredContentSizeCategory.isAccessibilityCategory is true.

4. Nothing that holds text has a fixed height

Use .frame(minHeight:), never .frame(height:), around text. In UIKit, use greaterThanOrEqualTo constraints instead of heightAnchor.constraint(equalToConstant:).

5. Truncate list rows only, never detail text

A lineLimit is fine on a list row that opens a detail screen. Raise it at accessibility sizes, for example .lineLimit(typeSize.isAccessibilitySize ? 4 : 2). Detail text always wraps. And minimumScaleFactor shrinks text to fit, which is the opposite of what the person asked for. Don't use it as a scaling strategy.

6. Meaningful icons grow with the text

SF Symbols scale when you give them a text style: Image(systemName: "bell").font(.body). For other sizes, such as a badge or a numbered circle, use @ScaledMetric(relativeTo: .body) private var iconSize: CGFloat = 24. Keep 44 pt as the minimum for tappable icons.

7. Sheets can grow

.presentationDetents([.medium]) alone gives a half-height sheet that can't grow. At large sizes its buttons get cut off. Use [.medium, .large] and put the content in a ScrollView.

8. Don't cap content

Capping Dynamic Type to protect a layout takes away the size the person needs. A fixed bar, like a custom tab bar, may stay fixed, but only with the Large Content Viewer. That's the enlarged view people get when they long-press a control at accessibility sizes:

CustomTabItem(title: "Home", icon: "house")
    .accessibilityShowsLargeContentViewer {
        Label("Home", systemImage: "house")
    }

If you must limit a bar, use a range like .dynamicTypeSize(...DynamicTypeSize.xxxLarge). Note that .dynamicTypeSize(.large) pins one size. It isn't a cap.

9. Bold Text works too

Text styles and relativeTo: custom fonts follow the Bold Text setting. For custom strokes and symbol weights, read @Environment(\.legibilityWeight) and make them thicker when it's .bold.

Two traps

Inner HStacks. In one real app, a list row's outer stack was already adaptive. But the photo and text sat in a plain inner HStack, and the favorite button sat in another. At AX5, the 44 pt photo and the 44 pt heart each took a column. The pose name wrapped in a strip a few characters wide. Check every HStack inside a row, not only the outer one.

A plain Spacer in an adaptive stack. In the vertical layout, a Spacer can take all the height it's offered. In one app it left a screen-high gap inside a Stepper label. Use a spacer that only exists in the horizontal layout:

struct AStackSpacer: View {
    @Environment(\.dynamicTypeSize) private var dynamicTypeSize
    var body: some View {
        if !dynamicTypeSize.isAccessibilitySize { Spacer() }
    }
}

A related bug: when the text size changes while a screen is open, SwiftUI can keep a List row's old height and cut custom card text to one line. Add .fixedSize(horizontal: false, vertical: true) to text inside custom cards in List and Form rows.

How to test

Start with previews. Add one at AX5 and one in landscape at AX5, the worst case for reaching content:

#Preview("AX5 text") { ContentView().environment(\.dynamicTypeSize, .accessibility5) }
#Preview("Landscape, AX5", traits: .landscapeLeft) {
    NavigationStack { ContentView() }.environment(\.dynamicTypeSize, .accessibility5)
}

In the simulator, set the largest size from the command line with xcrun simctl ui booted content_size accessibility-extra-extra-extra-large, and reset it with content_size large. In UI tests, launch with -UIPreferredContentSizeCategoryName UICTContentSizeCategoryAccessibilityXXXL.

On a device, go to Settings → Accessibility → Display & Text Size → Larger Text and turn on Larger Accessibility Sizes. Then check:

  • At AX3 and AX5, no essential text is cut off, clipped or overlapping, and every screen scrolls.
  • Rows stack instead of squeezing.
  • In landscape at AX5, you can scroll to every piece of text and every control, including bottom buttons.
  • Fixed bars show the Large Content Viewer on long-press.
  • The smallest size still looks right, and Bold Text reaches custom fonts.

Test after a fresh launch and after changing the size while the screen is open. Also rotate every screen. Turning the phone is how many large-text users get more width, so locking a screen to portrait without a real reason fails WCAG 1.3.4, Orientation.

Let your AI assistant apply the checklist

If you build with Claude Code or another assistant that reads skills, the rules above are available as a free skill: ios-dynamic-type-skill on GitHub. It applies them while it writes SwiftUI and UIKit code, and it can audit a screen and rank what it finds. Dynamic Type is one part of accessibility. For VoiceOver, Voice Control, contrast, motion and the rest, see the iOS Sidekick.