Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

swift 5 on return button action

Swift 5:
class YourClass: UIViewController, UITextFieldDelegate {
  
  	// will trigger when return button from keyboard is pressed
    func textFieldShouldReturn(_ textField: UITextField) -> Bool {
        performAction(textField)
        return true
    }
  
  	private func preformAction(_ textField:UITextField){
    	//... code here ...
    }
}
 
PREVIOUS NEXT
Tagged: #swift #return #button #action
ADD COMMENT
Topic
Name
2+6 =