Scaling widget text with `sizeThatFits`

According to the WidgetKit docs for Lock Screen Widgets and Watch Complications, the recommended way to scale text within a widget is to use the sizeThatFits API ("Use SwiftUI’s sizeThatFits(_:) API to scale text so that it fits available space.")

I can't find any examples of sizeThatFits being used this way, so I don't really understand how to implement this...

So far I am just using minimumScaleFactor, which works fine, so I'm not sure what I'm missing here.

Post not yet marked as solved Up vote post of ddramowicz Down vote post of ddramowicz
456 views