I’ve just published a small sample project to provide a reusable keyboard listener that will ensure that an input field won’t be hidden under the keyboard.
This require to embed your input fields inside a UIScrollView object.
If you are using a UITableView, this is already the case.
You need to implement a getter closure that will return the currently active input field.
How can you use this class?
Just import the framework:
Then your controller shall declare a variable to keep reference to the listener:
Creat the listener when the view is loaded:
And that’s all.
More information in the repository Swift-SGiTKeyboardListener
Feedback is welcome!