[self.view endEditing:NO]; The parameter passed in by this method is whether it is mandatory. Under normal circumstances, it will work even if no is passed.
Resign as the first responder of the current control or Turn off the editable state of the parent control
Choose one of the two to close the keyboard If you write it all, it will be like fighting the landlord: One person robbed the landlord, and the trump card was taken away. Will others come back if they don't take advantage of the situation?
[self.view endEditing:NO];
The parameter passed in by this method is whether it is mandatory. Under normal circumstances, it will work even if no is passed.What works is just resignFirstResponder
QAQ Approval of the answer requires reputation, so let me reply first. Everyone above is correct
Resign as the first responder of the current control
or
Turn off the editable state of the parent control
Choose one of the two to close the keyboard
If you write it all, it will be like fighting the landlord:
One person robbed the landlord, and the trump card was taken away. Will others come back if they don't take advantage of the situation?