now I'm trying to animate the selected cell to move to the top, that means first position with sliding up and down animation.
If the tableview had more than two items, the user click the second one or third one, the selected cell will move to the first position, the first one comes to second and second one comes to third.
I have search and implement with some examples, but I have only move with duplicate cell one.
Here below is my code,
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"didSelectRowAtIndexPath = %d",indexPath.row);
[tableView beginUpdates];
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
withRowAnimation:UITableViewRowAnimationTop];
[tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
withRowAnimation:UITableViewRowAnimationTop];
// update your dataSource as well.
[tableView endUpdates];
[coachInfoTableView reloadData];
}
If you any body know the solution for this one kindly update me. I will really appreciate you.