Last active
September 2, 2017 10:20
-
-
Save hashaam/1e96dd6ee50631e8631fb9dda62edd81 to your computer and use it in GitHub Desktop.
Adjust Scroll View Content Inset Based on Keyboard Frame
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
// https://hashaam.com/2017/09/02/adjust-scroll-view-content-inset-based-on-keyboard-frame | |
override func viewWillAppear(_ animated: Bool) { | |
NotificationCenter.default.addObserver(self, selector: #selector(adjustForKeyboardHandler(notification:)), name: NSNotification.Name.UIKeyboardWillChangeFrame, object: nil) | |
NotificationCenter.default.addObserver(self, selector: #selector(adjustForKeyboardHandler(notification:)), name: NSNotification.Name.UIKeyboardWillHide, object: nil) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment