Last active
May 10, 2021 22:06
-
-
Save peantunes/62ad541b66954058f6ec4ecca9650fd9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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