Instance Property

canResignFirstResponder

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

Declaration

var canResignFirstResponder: Bool { get }

Return Value

true if the receiver can resign first-responder status, false otherwise.

Discussion

This method returns true 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 false to ensure that the user corrects that content first.

See Also

Managing the Responder Chain

var next: UIResponder?

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

var isFirstResponder: Bool

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

var canBecomeFirstResponder: Bool

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

func becomeFirstResponder() -> Bool

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

func resignFirstResponder() -> Bool

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

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software