0

I've seen other questions on how to detect a backspace in an empty UITextField (UIKit). However, is there an easy way to do this with SwiftUI or using Introspect? Doing it with a textfield which is populated is quite simple, but I haven't been able to find a way to do it with an empty textfield.

Thank you!

gavinmccabe
  • 129
  • 7

1 Answers1

0

I can't comment so I'll just put this as an answer instead. Even though it's for UIKit you can still wrap it in a UIViewRepresentable to place it in your SwiftUI code. You may know that already, so if you truly want pure SwiftUI, you may be out of luck here. Hopefully more TextField features are migrated to SwiftUI soon.

Intronaen
  • 108
  • 8