Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Sources/Showcase/TextPlayground.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ struct TextPlayground: View {
var redaction: RedactionReasons = []
let markdownVar = "String `var` with markdown"

private var welcomeAttributedText: AttributedString {
var attributedString = AttributedString("Welcome to Skip")
attributedString.font = .system(size: 16)
attributedString.foregroundColor = .blue
attributedString.underlineStyle = .single
return attributedString
}

private var concatenatedAttributedText: AttributedString {
var a = AttributedString("Hello ")
a.foregroundColor = .blue
var b = AttributedString("World")
b.foregroundColor = .green
return a + b
}

var body: some View {
ScrollView {
VStack(spacing: 16) {
Expand Down Expand Up @@ -70,6 +86,10 @@ struct TextPlayground: View {
.italic()
#endif

Text(welcomeAttributedText)
Text(concatenatedAttributedText)
Text(verbatim: "Left ") + Text(verbatim: "Right")

Divider()

Text("Wrap: This is some long text that should wrap when it exceeds the width of its frame")
Expand Down
Loading