Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)scrollViewDidScroll:(UIScrollView *)scrollView
- {
- if (scrollView.panGestureRecognizer.state != UIGestureRecognizerStateBegan) {
- return;
- }
- if ([scrollView.panGestureRecognizer translationInView:scrollView].y <= 0) {
- return;
- }
- if (self.keyboardIsShown) {
- [self.messageTextView resignFirstResponder];
- }
- }
- - (void)adjustTableViewForMessageToolBarWithScrollToBottom:(BOOL)scrollToBottom
- {
- self.tableView.contentInset = [self contentInsets];
- if (scrollToBottom) {
- CGRect frame = CGRectZero;
- frame.size.width = CGRectGetWidth(self.tableView.frame);
- frame.size.height = 10;
- frame.origin.y = self.tableView.contentSize.height - 10;
- [self.tableView scrollRectToVisible:frame animated:NO];
- }
- }
- - (UIEdgeInsets)contentInsets
- {
- CGFloat topInset = CGRectGetMaxY(self.navigationController.navigationBar.frame);
- CGFloat bottomInset = CGRectGetHeight(self.view.frame) - CGRectGetMinY(self.messageToolBar.frame);
- return UIEdgeInsetsMake (topInset, 0, bottomInset, 0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement