Skip to content

Commit

Permalink
Fixed #13
Browse files Browse the repository at this point in the history
  • Loading branch information
arturdev committed Jul 4, 2014
1 parent 4d4945b commit 6c7a977
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions SOMessaging/SOMessagingViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,12 @@ - (void)refreshMessages
[self.tableView reloadData];

NSInteger section = [self.tableView numberOfSections] - 1;
NSInteger row = [self.tableView numberOfRowsInSection:section] - 1;
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:row inSection:section];
if (row >= 0) {
[self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES];
if (section > 0) {
NSInteger row = [self.tableView numberOfRowsInSection:section] - 1;
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:row inSection:section];
if (row >= 0) {
[self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES];
}
}
}

Expand Down

0 comments on commit 6c7a977

Please sign in to comment.