In table view, I am adding new cells (to the top of table view) with animation (background color of cells changing from gray to default white). All works fine, but it animates only cells, that is visible on the screen. So, if count of rows more that display can show, it doesn't animate the rest of cells.
This is my code for animating cells (I use it in my custom update table view method, after insertion of new rows. InsertingArray consists of IndexPath's of rows that should be animated):
for (int i=0; i<[insertingArray count]; i++)
{
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:[insertingArray objectAtIndex:i]];
cell.backgroundColor = [UIColor grayColor];
[UIView animateWithDuration:1.0
delay: 1.0
options: UIViewAnimationOptionCurveEaseIn
animations:^{
cell.backgroundColor = [UIColor whiteColor];
}
completion:nil];
}
So, how fix it and animate all rows, that was added in table view?