[Solved] How do I implement UITextFieldDelegate [closed]
[ad_1] Your ViewController should be an UITextFieldDelegate. You then set the current ViewController as the delegate of the textField, in this case in viewDidLoad(). Implement textFieldShouldReturn so the textField delegates the return task (textFieldShouldReturn) to the ViewController. In this method call resignFirstResponder, this way the keyboard will disappear. Example: import UIKit class ViewController: UIViewController, UITextFieldDelegate … Read more