I have a UITableView, and when it stops scrolling (scrollViewDidEndDecelerating:) the height of the current cell expands by setting the variable currentRow and reloading:
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
CGFloat current_offset = self.tableView.contentOffset.y;
currentRow = [self.tableView indexPathForRowAtPoint:CGPointMake(0, current_offset)].row;
[self.tableView beginUpdates];
[self.tableView endUpdates];
};
The animation works fine, but it temporarily prevents the tableview from being scrollable/interactive. So if I touch the screen while the cell is expanding, I end up not being able to scroll unless I try again.
Is there a workaround or another way to achieve the same effect?
You can use this method, to stop animations,
but I'm not sure that it will not make problems.
- (void)stopAnimations { for (UITableViewCell *cell in [self.tableView visibleCells]) { [cell.layer removeAllAnimations]; } }
Try adding this on your TableViewController
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [self stopAnimations]; }
or try to add tap gesture recognizer to Application's window and then call stopAinimations on gesture trigger.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With