In what situation will self.view.endEditing(true)
and self.view.endEditing(false)
produce different results?
The docs for func endEditing(force: Bool) -> Bool
state the following for the parameter force
:
Specify
true
to force the first responder to resign, regardless of whether it wants to do so.
As the comment mentioned, if canResignFirstResponder
returns false, self.view.endEditing(true)
will cause the control to lose focus but self.view.endEditing(false)
will not.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With