Last active
August 29, 2015 14:27
-
-
Save soberman/def4ad03fb531b21d916 to your computer and use it in GitHub Desktop.
How to get iOS keyboard height programmatically
This file contains hidden or 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
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(keyboardWillShow:) | |
name:UIKeyboardWillChangeFrameNotification | |
object:nil]; | |
} | |
- (void)keyboardWillShow:(NSNotification *)notification { | |
NSLog(@"%f", [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue].size.height); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment