Is there a way to have the screen only move when the bottom fields are edited?
I had a similar problem and found a pretty straightforward solution without using a scrollView, and instead using if statements within the keyboardWillShow/Hide methods.
func keyboardWillShow(notification: NSNotification) {
if bottomText.editing{
self.view.window?.frame.origin.y = -1 * getKeyboardHeight(notification)
}
}
func keyboardWillHide(notification: NSNotification) {
if self.view.window?.frame.origin.y != 0 {
self.view.window?.frame.origin.y += getKeyboardHeight(notification)
}
}
This was a good solution for me because I only had two text fields.
Shifts whole view up: only when certain text fields (bottomText) are edited
Shifts whole view down: only when the view is not at the original location