adwaita-swift/Sources/Demo/TextEditorDemo.swift
david-swift 049b5b54f8
Some checks failed
SwiftLint / SwiftLint (push) Successful in 6s
Deploy Docs / publish (push) Has been cancelled
Add support for text editors
2025-08-09 10:48:04 +02:00

39 lines
743 B
Swift

//
// TextEditorDemo.swift
// Adwaita
//
// Created by david-swift on 09.08.25.
//
// swiftlint:disable missing_docs
import Adwaita
import Foundation
struct TextEditorDemo: View {
@State private var text = "Hello, world!"
var view: Body {
VStack(spacing: 20) {
TextEditor(text: $text)
.innerPadding(20)
.frame(minHeight: 60)
.card()
VStack {
Text(text)
.selectable()
.wrap()
.hexpand()
.padding(20)
.halign(.fill)
}
.card()
}
.frame(maxWidth: 500)
}
}
// swiftlint:enable missing_docs