Answers for "swift text field enter action"

1

xcode perform action when return key pressed text field

class SomeViewControllerClass : UIViewController, UITextFieldDelegate {

    override func viewDidLoad() {
        super.viewDidLoad()

        self.textField.delegate = self
    }

    func textFieldShouldReturn(textField: UITextField) -> Bool {

        //textField code

        textField.resignFirstResponder()  //if desired
        performAction()
        return true
    }

    func performAction() {   
        //action events
    }
}
Posted by: Guest on September-02-2020

Code answers related to "swift text field enter action"

Code answers related to "Swift"

Browse Popular Code Answers by Language