Answer the question
In order to leave comments, you need to log in
Why does the keyboard fall off after each character entered in the SwiftUI TextField and how best to fix it?
I have an ObservableObject in parent View and child View:
import Parchment
class MainViewModel: ObservableObject {
@Published var inputText = String()
init() {}
}
struct ChildView: View {
@EnvironmentObject var viewModel: MainViewModel
var body: some View {
PageView(/**/) {
TextField("", $viewModel.inputText)
}
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question