Text Dynamic Type clarification and ScaledMetric example extend#46
Text Dynamic Type clarification and ScaledMetric example extend#46EngOmarElsayed merged 2 commits intoAvdLee:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4f937095ac
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Image(systemName: "checkmark.circle.fill") | ||
| .frame(width: iconSize, height: iconSize) |
There was a problem hiding this comment.
Size SF Symbols with font, not only frame
In the new StatusRow example, iconSize is meant to track Dynamic Type, but applying it only via .frame(width:height:) does not resize the SF Symbol glyph itself; it only changes the view’s layout box. As a result, the icon will not stay proportional to text size when content size category changes, which undermines the guidance in this section. Use a symbol-sizing modifier (for example, .font(.system(size: iconSize))) or a truly resizable image pattern so the symbol actually scales.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
This PR improves the SwiftUI accessibility reference by expanding and clarifying guidance around Dynamic Type behavior for both text and non-text values, including proper usage of @ScaledMetric and Dynamic Type-aware custom fonts.
Changes:
- Renames the Dynamic Type section to cover both text scaling and
@ScaledMetric. - Adds examples for built-in text styles and Dynamic Type-aware custom fonts (
Font.custom(..., relativeTo:)). - Extends
@ScaledMetricguidance to include non-text values (spacing, icons, image sizes) and updates the checklist accordingly.
Thanks! |
Summary
Improve the accessibility reference with more complete guidance for Dynamic Type in SwiftUI since original info uses it without clarification.
Changes
@ScaledMetricFont.custom(_:size:)andFont.custom(_:size:relativeTo:)@ScaledMetricguidance to cover non-text values like spacing, icons, and image sizesTesting