I have a similar problem. Isn't there a solution?
struct ContentView: View {
@State private var text: String = ""
var body: some View {
VStack {
Text(text)
.padding()
TextEditor(text: $text)
.frame(width: 300, height: 200)
.padding()
Button(action: {
print(text)
}, label: {
Text("Done")
})
.keyboardShortcut(.defaultAction)
.padding()
}
}
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: