In the simulator, everything is ok. However, in live preview mode of canvas, no keyboard pops up when I tap in the textfield. Did I miss anything? Or need more codes in preview?Thanks in advance.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I make a toggle to control a textfield in a form. When I run it, I get a piece of warning:
invalid mode 'kCFRunLoopCommonModes' provided to CFRunLoopRunSpecific - break on _CFRunLoopError_RunCalledWithInvalidMode to debug. This message will only appear once per execution
What could I do to fix it? What's the harm if it's not fixed( App crashes, or...?). Any help will be appreciated.
struct ContentView: View {
@State private var toggle1 = true
@State private var str1 = "..."
var body: some View {
Form{
Section{
Toggle(isOn: $toggle1, label: {
Text("Toggle 1")})
}
Section{
if toggle1{
HStack{
Text("Toggle 1")
TextField("...", text: $str1)
}
}
}
.textFieldStyle(RoundedBorderTextFieldStyle())
}
}
}