From b456a10d649e272dd464094cd3b54c13331761ca Mon Sep 17 00:00:00 2001 From: Cesare Date: Sat, 12 Jan 2013 15:54:40 +0100 Subject: [PATCH] Scrolling down table when input field slides up --- Classes/SSMessagesViewController.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Classes/SSMessagesViewController.m b/Classes/SSMessagesViewController.m index 62697e6..1b86878 100644 --- a/Classes/SSMessagesViewController.m +++ b/Classes/SSMessagesViewController.m @@ -147,6 +147,13 @@ - (void)textFieldDidBeginEditing:(UITextField *)textField { _inputBackgroundView.frame = CGRectMake(0.0f, 160.0f, self.view.frame.size.width, kInputHeight); [_sendButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [UIView commitAnimations]; + + NSIndexPath *indexPath = [NSIndexPath indexPathForRow:[_tableView numberOfRowsInSection:0]-1 + inSection:0]; + + [_tableView scrollToRowAtIndexPath:indexPath + atScrollPosition:UITableViewScrollPositionBottom + animated:YES]; }