-
Notifications
You must be signed in to change notification settings - Fork 31
Fonts
Nick Sarno edited this page Apr 9, 2022
·
2 revisions
Use .withFont to easily add font-related modifiers to any View.
Text("Hello, world.")
.withFont(font: .headline, color: .red)
Optionally customize the lineLimit and minimumScaleFactor.
Text("Hello, world.")
.withFont(font: .headline, color: .red, lineLimit: 3, minimumScaleFactor: 0.7)
Use the animatable method if the font color should animate. The color will animate using colorMultiply, since foregroundColor is not animatable by default.
Text("Hello, world.")
.withFontAnimateable(font: .headline, color: isActive ? Color.red : .blue)