Instance Property

canResignFirstResponder

Returns a Boolean value indicating whether the receiver is willing to relinquish first-responder status.

Declaration

@property(nonatomic, readonly) BOOL canResignFirstResponder;

Return Value

YES if the receiver can resign first-responder status, NO otherwise.

Discussion

This method returns YES by default. You can override this method in your custom responders and return a different value if needed. For example, a text field containing invalid content might want to return NO to ensure that the user corrects that content first.

See Also

Managing the Responder Chain

nextResponder

Returns the next responder in the responder chain, or nil if there is no next responder.

isFirstResponder

Returns a Boolean value indicating whether this object is the first responder.

canBecomeFirstResponder

Returns a Boolean value indicating whether this object can become the first responder.

becomeFirstResponder

Asks UIKit to make this object the first responder in its window.

resignFirstResponder

Notifies this object that it has been asked to relinquish its status as first responder in its window.