1

I'm using UIViewRepresentable to wrap a UITextField in order to create a TextField view for SwiftUI which is more fully featured than the currently built-in one. The Coordinator class is of course the delegate of the UITextField. The delegate method textField(_:shouldChangeCharactersIn:replacementString:) is getting called when the user types a character (as it should), but also when an autocorrect suggestion comes up. As far as I know this is not normal UITextField behavior, and it's very troublesome. Is this because the text field is embedded in a SwiftUI view hierarchy?

4

0 回答 0