What's new in TypographyKit 5.0.0?
-
First-class support for SwiftUI colors - to obtain a color, use
TK.color(named:)
. -
You may specify a fallback color to be used in the event that you forget to define a color. Use the
fallback-color
key to specify which color should be used in this case.- Setting:
fallback-color
- Default: Black in light mode and white in dark mode.
- Setting:
-
You may specify a development color which is used in the event that you forget to define a color in development builds. This color may be different from the fallback color. For example, you may want to use an easily noticeable color such as red to make it visually clear that you have forgotten to define a color in development builds. However, you may want to ensure that this red color will never be shown in production builds - this is why development colors will never be shown in production builds (instead the fallback color will be used).
-
Setting:
development-color
-
Default:
red
-
Setting:
is-development
-
Default:
true
in #DEBUG builds;false
otherwise -
Setting:
should-use-development-colors
-
Default:
true
-
-
You may optionally specify that your development app builds crash if you forget to define a color. This makes it even less likely that you will forget to specify a color value during development. This setting only affects development builds so there is no need to worry that production builds might crash.
- Setting:
should-crash-if-color-not-found
- Default:
false
- Setting:
-
To start using the framework, now
import TypographyKit
and then configure as follows:
TypographyKit.configure(
with: TypographyKitConfiguration.default
.setConfigurationURL(configurationURL)
)
Alternatively, an async
version of this method exists for developers supporting iOS 13 and above:
await TypographyKit.configure(with:
TypographyKitConfiguration.default.setConfigurationURL(configurationURL)
)
- All configuration properties specified programmatically may alternatively be specified in the TypographyKit configuration file.
- Note: Values in the configuration file override those specified programmatically.
For a detailed list of changes, see CHANGELOG.md.