Jared Sinclair 3/2/2024

Scaled Metric Surprises on iOS & iPadOS

Read Original

This technical article details how UIKit's UIFontMetrics.scaledValue(for:) and SwiftUI's @ScaledMetric property wrapper do not scale values proportionally to the default system font sizes for a given text style (e.g., .body). It demonstrates the divergence with code examples and recommends directly using a UIFont's pointSize for exact proportional scaling with dynamic type.

Scaled Metric Surprises on iOS & iPadOS

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week