Last active
October 15, 2021 05:47
-
-
Save aheze/1decd6d1bfa1f42c21090ab680e16454 to your computer and use it in GitHub Desktop.
This file contains 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
struct ContentView: View { | |
var body: some View { | |
VStack(spacing: 40) { | |
/// Note: You can replace `$0` with `string in string` | |
VStack { | |
Text("Regular") | |
Text("Italics") { $0.font = Font.system(size: 17).italic() } | |
Text("Bold") { $0.font = Font.system(size: 17).bold() } | |
Text("Strikethrough") { $0.strikethroughStyle = Text.LineStyle(pattern: .solid, color: .red) } | |
Text("Code") { $0.font = Font.system(size: 17, design: .monospaced) } | |
Text("Foreground Color") { $0.foregroundColor = Color.purple } | |
Text("Background Color") { $0.backgroundColor = Color.yellow } | |
Text("Underline") { $0.underlineColor = Color.green } | |
} | |
VStack { | |
Text("Kern") { $0.kern = CGFloat(10) } | |
Text("Tracking") { $0.tracking = CGFloat(10) } | |
} | |
VStack { | |
Text("Baseline Offset") { $0.baselineOffset = CGFloat(10) } | |
Text("Link") { $0.link = URL(string: "https://apple.com") } | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment