I'm new here and im starting with Swift for iOS.
I started creating a simple app that does some operations. But I'm having some problems when the keyboard appears, hiding one of my textFields. I think it's a common problem and I did some research but I couldn't find anything that solved my problem. And I want to use a Scroll rather than animate the textField to make it visible.
Thanks!!!!! (sorry for english mistakes)
The top answer for swift 3:
And then:
In ViewDidLoad, register the notifications:
Add below observer methods which does the automatic scrolling when keyboard appears.
EDIT: This post was updated to reflect best practices in Swift 2.2 for Objective C selectors.
An answer for Swift 3, based on the one proposed by Daniel Jones, but safer (thanks to the guard), more concise and with consistent scroll indicator insets:
In case anyone is looking for Objective-C code for this solution:
In Swift4, just add the following extension.