Skip to content

Instantly share code, notes, and snippets.

@peantunes
Last active May 10, 2021 22:06
Show Gist options
  • Save peantunes/62ad541b66954058f6ec4ecca9650fd9 to your computer and use it in GitHub Desktop.
Save peantunes/62ad541b66954058f6ec4ecca9650fd9 to your computer and use it in GitHub Desktop.
private struct XXLTextViewModifier: ViewModifier {
let size: CGFloat
func body(content: Content) -> some View {
content
.font(.system(size: size*40))
}
}
extension View {
func xxlText(_ size: CGFloat = 2) -> some View {
modifier(XXLTextViewModifier(size: size))
}
}
struct XXLTextViewModifier_Previews: PreviewProvider {
static var previews: some View {
Text("🌴")
.xxlText(3)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment