Instance Method

textFieldDidEndEditing:reason:

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

Declaration

- (void)textFieldDidEndEditing:(UITextField *)textField reason:(UITextFieldDidEndEditingReason)reason;

Parameters

textField

The text field for which editing ended.

reason

The reason why editing ended. Use this field to determine whether to incorporate the text editing changes or abandon them.

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. UIKit calls this method in preference to the textFieldDidEndEditing: method.

See Also

Managing Editing

- textFieldShouldBeginEditing:

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

- textFieldDidBeginEditing:

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

- textFieldShouldEndEditing:

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

- textFieldDidEndEditing:

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

UITextFieldDidEndEditingReason

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