Closed iannotian closed 5 years ago
Setting the view's y-coordinate to zero when keyboardWillHide() is called seems to fix this.
In LoginViewController.swift:
func keyboardWillHide(notification: NSNotification) { if keyboardOnScreen { view.frame.origin.y = 0 movieImageView.hidden = false } }
I'm also seeing this happen in the simulator as well as on a physical device.
I modified both the keyboardWillShow
& keyboardWillHide
methods:
func keyboardWillShow(_ notification: Notification) {
if !keyboardOnScreen {
view.frame.origin.y = -keyboardHeight(notification)
movieImageView.isHidden = true
}
}
func keyboardWillHide(_ notification: Notification) {
if keyboardOnScreen {
view.frame.origin.y = 0
movieImageView.isHidden = false
}
}
and that got the behaviour I wanted.
Closing this out as there's a new version of the course.
To recreate this issue, while on the Login page for the MyFavoriteMovies starter app, tap inside a UITextField and while the cursor is blinking (indicating you are currently editing the UITextField), quickly tap outside of the UITextField. If you're fast enough, the view will not reset back to zero, and it can eventually be pushed too far upward to interact with. I've attached some screenshots showcasing this:
Note: I haven't tried this on an actual iOS device; I've only tried this through a simulator.