Advertisement
Guest User

Untitled

a guest
Nov 27th, 2015
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (void)keyboardWillShow:(NSNotification *)notification {
  2.     [self.view layoutIfNeeded];
  3.     CGSize keyboardSize = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue].size;
  4.     self.postButtonBotConstraint.constant = keyboardSize.height;
  5.     [UIView animateWithDuration:[notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue] delay:0.0 options:[notification.userInfo[UIKeyboardAnimationCurveUserInfoKey] integerValue] << 16 animations:^{
  6.         [self.view layoutIfNeeded];
  7.     } completion:nil];
  8. }
  9.  
  10. - (void)keyboardWillBeHidden:(NSNotification *)notification {
  11.     self.postButtonBotConstraint.constant = 0;
  12.     [UIView animateWithDuration:[notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue] delay:0.0 options:[notification.userInfo[UIKeyboardAnimationCurveUserInfoKey] integerValue] << 16 animations:^{
  13.         [self.view layoutIfNeeded];
  14.     } completion:nil];
  15.     //    [self.scrollView setContentOffset:(CGPoint){0, 0} animated:YES];
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement