textFieldShouldBeginEditing(_:)
Asks the delegate whether to begin editing in the specified text field.
Declaration
optional func textFieldShouldBeginEditing(_ textField: UITextField) -> BoolParameters
- textField:
The text field in which editing is about to begin.
Return Value
Discussion
The text field calls this method when the user performs an action that would normally initiate the editing of the text field’s text. Implement this method if you want to prevent editing from happening in some situations. For example, you could use this method to prevent the user from editing the text field’s contents more than once. Most of the time, you should return true to allow editing to proceed.
If you do not implement this method, the text field acts as if this method had returned true.