Skip to content

Instantly share code, notes, and snippets.

@aheze
Last active October 15, 2021 05:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aheze/1decd6d1bfa1f42c21090ab680e16454 to your computer and use it in GitHub Desktop.
Save aheze/1decd6d1bfa1f42c21090ab680e16454 to your computer and use it in GitHub Desktop.
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