Xcode Accessibility Inspector incorrectly claims Dynamic Type font sizes are unsupported.

I'm using Dynamic Font throughout my entire app yet the audits in Accessibility Inspector will give me a ton of "Dynamic Type font sizes are unsupported: User will not be able to change the font size of this SwiftUI.AccessibilityNode" warnings.

This is incorrect because users are able to change the font size. I can even move to the inspector panel and adjust the font and see it all change right within the Accessibility Inspector.

I assume this is a bug since I can change the font but I was also wondering if there's some special thing I'm missing that could prevent these warnings from appearing especially when management runs audits to look for deficiencies.

Thanks for the post. This is one that I’m sure many developers here would like to see it on a focused sample project.

Do you get the same results with just the relevant code in a small test project? If so, please share a link to your test project. That'll help us better understand what's going on. If you're not familiar with preparing a test project, take a look at Creating a test project.

Would be great to see those warnings and see how it behaves.

The Accessibility Inspector when it runs an audit for Dynamic Type, it looks at the underlying accessibility elements and checks for specific UIKit properties, specifically, whether adjustsFontForContentSizeCategory is set to true on a UILabel or UITextView.

SwiftUI, however, handles text rendering and accessibility tree generation differently. It abstracts the text drawing, and the synthesized SwiftUI.AccessibilityNode exposed to the Inspector does not always pass along that specific UIKit-level flag in a way the older audit heuristics expect.

If you are using system fonts (e.g., .font(.body), .font(.title)), you are doing everything right.

If you are using custom fonts, ensure you are using the relativeTo: parameter so the system knows how to scale it.

Albert
  Worldwide Developer Relations.

Xcode Accessibility Inspector incorrectly claims Dynamic Type font sizes are unsupported.
 
 
Q