Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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