Answers for "keyboard return button action swift"

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 "keyboard return button action swift"

Code answers related to "Swift"

Browse Popular Code Answers by Language