Expand SystemImage protocol to load scalable system images by default
mpospese opened this issue · comments
Mark Pospesel commented
Our SystemImage
protocol should load scalable system images by default. We do that by loading the image with UIImage.SymbolConfiguration(textStyle: aTextStyle)
. This allows the image scale according to the specified text style when Dynamic Type changes. And it will respond to Bold Text as well (to use heavier strokes).
- add a
static var textStyle: UIFont.TextStyle?
with default implementation =.body
- add a
static var configuration: UIImage.Configuration
with default implementation =UIImage.SymbolConfiguration(textStyle: textStyle)
whentextStyle != nil
(need to see what configuration to use when it's nil. Maybe nil or maybe some default configuration that does nothing)
Idea is the following:
- By default system images will scale according to
.body
- It's simple to override and specify a different text style if you need it a bit bigger or smaller; e.g.
callout
ortitle
- If needed you can also provide any configuration. e.g. in addition to textStyle you might also want to configure weight (e.g.
ultralight
orbold
) to adjust the appearance of the symbol. It's also an opportunity to apply hierarchical or palette information.