iqbalzas iqbalzas - 6 months ago 26
Swift Question

How to dismiss keyboard on ALL textField?

Is there a way to dismiss keyboard without referencing the UITextField outlet one by one?

Answer Source

Swift 3.x Use this:

self.view.endEditing(true) //when you are using a view
self.tableView.endEditing(true) //when you are a table-view

The view will resign the keyboard from all child. You call it when a user touches the table or view.

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