I know that there are several questions on this topic, but i have not been able to find any on [SWIFT 5.0] or more, and would really appreciate your help.
I have a UITextFeild at the bottom of the screen which gets hidden every time the user clicks on it. Is there a recent method on which i can solve this hiding issue, by either the textFeild following the keyboard to the top or a sample field appearing on top of the keyboard. Any help would be greatly appreciated, thank you!
2
Answers
You can use the following code:
First, add these two lines of code in your controller viewDidLoad() method:
Second, add these two methods inside your controller:
Enjoy :).
If you use AutoLayout you may try
Keyboard
andKeyboardLayoutGuide
from my collection of handy Swift extensions and classes called SwiftToolkitAdd this code to your controller
viewDidLoad()
method:When the keyboard appears it will push your UITextField up like this: