Avatar ·

How to track text changes in UITextField in real time (Swift)

Hi everyone! I'm a beginner in iOS development with Swift and I've run into a problem that I haven't been able to solve for several hours.\n\nI have a simple screen with a UITextField for entering an email. I need that with every text change (entering or deleting a character), email validation is performed and an icon (checkmark or cross) is shown next to the field. I want this to happen in real time, not after the user finishes typing and presses "Done".\n\nI tried using the UITextFieldDelegate and the textFieldDidEndEditing method, but it only triggers when the field loses focus. I also tried textFieldShouldReturn — that's not it at all.\n\nHere's my current code that doesn't work as needed:\n\n```swift\nclass ViewController: UIViewController, UITextFieldDelegate {\n \n @IBO