Unable to enter text in TextField - SwiftUI preview

I'm trying out Xcode 12 (beta) and encountered an issue with TextField when viewing it in a live Preview.

Although the view is interactive (scrolling vertically seems to be OK) and a cursor appears in the TextField view when it is clicked on, keyboard input is ignored.

The same code works as expected in Xcode 11.5. Simulator in both 11.5 and 12 exhibits expected behaviour.

Is this a bug? I know there is an issue with interactivity in Preview with multiple views inside PreviewProvider but I'd assumed this is if you'd added multiple Views to the same body of this struct.


  • Same issue with Xcode 13.2.1, I downloaded from the Application Store, I downloaded from the Developers website, the same error, I cannot enter info on a TextField in Preview, the cursor appear, I can paste, but not enter data from the keyboard. I can enter data when I run the sample in my phone.

  • I'm trying to get my head around Xcode Swift 5. It really doesn't help with understanding or confidence when the software tool itself is not being maintained well enough for what has evidently been a long standing bug to still exist as of January 26 2022. I'm using an M1 Macbook pro and fully up to date

    OS Monterey Version 12.1 (21C52) with Xcode Version 13.2.1 (13C100)

Add a Comment

Replies

Me too, Xcode 13.2.1. I agree with an early poster that it is not encouraging when a basic function of the preview is completely inoperative, and the bug has been known and remains unfixed a year after it was first reported.

Agreed this is disappointing on Apple’s part.

Meantime, try deleting Derived Data for the project, and quitting & restarting Xcode.

Hmm, here to report this was working flawlessly for me on Xcode 14.3, probably couple dozen times, until just now it stopped working all of a sudden.

  • Same issue here. It worked until it didn't. It doesn't work even if I export to iPhone

Add a Comment

Same here, in Xcode 15 beta 1.

Still Not Working XCODE 15.2

Strange, this recently just started happening to me out of nowhere.

I have struct in xcode 15.2 . I have unable to input in textfield in Live preview Please resolved as soon possible.