Skip to content

Text Dynamic Type clarification and ScaledMetric example extend#46

Merged
EngOmarElsayed merged 2 commits intoAvdLee:mainfrom
lanserxt:main
Mar 21, 2026
Merged

Text Dynamic Type clarification and ScaledMetric example extend#46
EngOmarElsayed merged 2 commits intoAvdLee:mainfrom
lanserxt:main

Conversation

@lanserxt
Copy link
Copy Markdown
Contributor

Summary

Improve the accessibility reference with more complete guidance for Dynamic Type in SwiftUI since original info uses it without clarification.

Changes

  • Rename the Dynamic Type section to cover both text scaling and @ScaledMetric
  • Add built-in SwiftUI text style examples for Dynamic Type-aware text
  • Document Dynamic Type-aware custom fonts with Font.custom(_:size:) and Font.custom(_:size:relativeTo:)
  • Expand @ScaledMetric guidance to cover non-text values like spacing, icons, and image sizes
  • Add a checklist item for using built-in text styles or Dynamic Type-aware custom fonts

Testing

  • Not run
  • Documentation-only change

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +71 to +72
Image(systemName: "checkmark.circle.fill")
.frame(width: iconSize, height: iconSize)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Collaborator

@EngOmarElsayed EngOmarElsayed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good mate

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 @ScaledMetric guidance to include non-text values (spacing, icons, image sizes) and updates the checklist accordingly.

@lanserxt
Copy link
Copy Markdown
Contributor Author

Looks good mate

Thanks!

@EngOmarElsayed EngOmarElsayed merged commit baf12c5 into AvdLee:main Mar 21, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants