Skip to content

Instantly share code, notes, and snippets.

@danielctull
Created July 19, 2012 11:51
Show Gist options
  • Select an option

  • Save danielctull/3143272 to your computer and use it in GitHub Desktop.

Select an option

Save danielctull/3143272 to your computer and use it in GitHub Desktop.
New moveDown
- (void)moveDown {
NSIndexPath *indexPath = [_tableViewController.tableView indexPathForSelectedRow];
UITableViewCell *cell = [_tableViewController.tableView cellForRowAtIndexPath:indexPath];
UIView *bg = cell.selectedBackgroundView;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.selectedBackgroundView = nil;
indexPath = [NSIndexPath indexPathForRow:indexPath.row+1 inSection:indexPath.section];
[_tableViewController.tableView selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewScrollPositionBottom];
cell = [_tableViewController.tableView cellForRowAtIndexPath:indexPath];
cell.selectionStyle = UITableViewCellSelectionStyleBlue;
cell.selectedBackgroundView = bg;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment