29 lines
570 B
Swift
29 lines
570 B
Swift
import SwiftUI
|
|
|
|
struct V: View {
|
|
@StateObject var vm = VM()
|
|
|
|
var body: some View {
|
|
VStack {
|
|
HStack {
|
|
Text("Check text field:")
|
|
Text("'\(vm.text)'")
|
|
.fontWeight(.bold)
|
|
}
|
|
|
|
TextField("Binding-3", value: $vm.text, formatter: TextFieldValueOwner())
|
|
.padding(8)
|
|
.border(Color.blue, width: 2)
|
|
|
|
Button(action: vm.join.send) {
|
|
Text("Join")
|
|
.padding(8)
|
|
.border(vm.isJoinAvailable ? Color.green : Color.red, width: 4)
|
|
}
|
|
|
|
}
|
|
.frame(width: 320)
|
|
.padding()
|
|
}
|
|
}
|