Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)viewDidAppear:(BOOL) animated {
- [super viewDidAppear:animated];
- // Register notification when the keyboard will be show
- [[NSNotificationCenter defaultCenter] addObserver:self
- selector:@selector(keyboardWillShow:)
- name:UIKeyboardWillShowNotification
- object:nil];
- // Register notification when the keyboard will be hide
- [[NSNotificationCenter defaultCenter] addObserver:self
- selector:@selector(keyboardWillHide:)
- name:UIKeyboardWillHideNotification
- object:nil];
- }
- - (void)keyboardWillShow:(NSNotification *)notification {
- CGRect keyboardBounds;
- [[notification.userInfo valueForKey:UIKeyboardFrameBeginUserInfoKey] getValue:&keyboardBounds];
- // Do something with keyboard height
- }
- - (void)keyboardWillHide:(NSNotification *)notification {
- CGRect keyboardBounds;
- [[notification.userInfo valueForKey:UIKeyboardFrameBeginUserInfoKey] getValue:&keyboardBounds];
- // Do something with keyboard height
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement