Last active
February 27, 2018 20:58
-
-
Save mlcollard/bf26b3c21dd4a3d793982916f37108eb to your computer and use it in GitHub Desktop.
iOS: Setup notification for keyboard disappearing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// shifts the view up for space for the keyboard | |
NotificationCenter.default.addObserver(forName: NSNotification.Name.UIKeyboardWillHide, object: nil, queue: nil) { | |
notification in | |
print("\(notification.description)") | |
// move back to original position | |
self.view.frame.origin.y = 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment