Unable to use hardware keyboard in Xcode 12 live previews

I am unable to use the hardware keyboard to enter text in text fields when using Xcode 12 live previews.

Same issue with all preview devices. Running on macOS 10.15.5.

Is there an option I am missing or a workaround for this?

Code Block
import SwiftUI
struct ContentView: View {
@State private var text = ""
var body: some View {
Form {
TextField("Write something", text: $text)
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}

Add a Comment

Accepted Reply

Howdy,

I am sorry to hear you are having issues using Xcode Previews. You have run in to a known issue that we hope to address in future release. The only known workaround is to use an on-device preview instead of the live version in the canvas.

Replies

Howdy,

I am sorry to hear you are having issues using Xcode Previews. You have run in to a known issue that we hope to address in future release. The only known workaround is to use an on-device preview instead of the live version in the canvas.
Keyboard input in Xcode Previews works again as of Xcode 12 Beta 2!

I am on Xcode Version 13.2.1 (13C100) and I am not able to use my hardware keyboard to input into the SwiftUI preview forms in the live version of the canvas. If I run the iOS Simulator I can use my physical keyboard without issue. Is this a known issue again, or something that I need to do on my end to make it work?

  • Same here, but my XCode is 13.2 (13C90). I search all the things but I cant still find the answer for this issue.

Add a Comment

I have the same problem in Xcode Version 13.2.1 (13C100), i have trying many ways but non results .

It's a known bug, hope Apple will fix it soon ...