Instance Method

textFieldDidEndEditing(_:)

Tells the delegate that editing stopped for the specified text field.

Declaration

optional func textFieldDidEndEditing(_ textField: UITextField)

Parameters

textField

The text field for which editing ended.

Discussion

This method is called after the text field resigns its first responder status. You can use this method to update your delegate’s state information. For example, you might use this method to hide overlay views that should be visible only while editing.

Implementation of this method by the delegate is optional. If your delegate also implements the textFieldDidEndEditing(_:reason:) method, UIKit calls that method in preference to this one.

See Also

Managing Editing

func textFieldShouldBeginEditing(UITextField) -> Bool

Asks the delegate if editing should begin in the specified text field.

func textFieldDidBeginEditing(UITextField)

Tells the delegate that editing began in the specified text field.

func textFieldShouldEndEditing(UITextField) -> Bool

Asks the delegate if editing should stop in the specified text field.

func textFieldDidEndEditing(UITextField, reason: UITextField.DidEndEditingReason)

Tells the delegate that editing stopped for the specified text field.

enum UITextField.DidEndEditingReason

Constants indicating the reason why editing ended in a text field.