Repaz Kung Repaz Kung - 1 year ago 143
iOS Question

Hide keyboard by pressing button

how can I hide the keyboard by simply pressing a button? For example when you want to type something into a textField and the keyboard should disappear after pressing a button which calls an action.

Answer Source
[self.view endEditing:YES]

Paste it in action handler of your controller. Or for Swift:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download