I am doing lazy loading for my UITableView so I am trying to reload individual rows as the images get updated. I am however running into a strange problem.
When I call,
[self.bubbleTableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath, nil] withRowAnimation:UITableViewRowAnimationNone];
OR
[self.bubbleTableView reloadSections:[NSIndexSet indexSetWithIndex:[indexPath section]] withRowAnimation:UITableViewRowAnimationNone];
When I specifically say No Animation it still animates and the animation is the Image taking up the entire cell and shrinking rapidly into the normal size. Also, if I change it to any other animation, it does the same animation no matter what setting.
If I comment either one of those out and just use reloadData it works fine, but I'd rather not do reloadData for performance reasons of reupdating cells that don't need updating.
Thanks!
Here was an answer
[UIView setAnimationsEnabled:NO];
[self.bubbleTableView reloadSections:[NSIndexSet indexSetWithIndex:[indexPath section]] withRowAnimation:UITableViewRowAnimationNone];
[UIView setAnimationsEnabled:YES];
It works for me.
UPD. Same with block by @Şafak-gezer
[UIView performWithoutAnimation:^{
[self.bubbleTableView reloadSections:[NSIndexSet indexSetWithIndex:[indexPath section]] withRowAnimation:UITableViewRowAnimationNone];
}];
SWIFT
UIView.performWithoutAnimation {
self.bubbleTableView.reloadSections(NSIndexSet(index: indexPath.section), withRowAnimation: UITableViewRowAnimation.None)
}
Below method worked for me: (for iOS 7 and better)
[UIView performWithoutAnimation:^{
[tableView reloadSections:[NSIndexSet indexSetWithIndex:[indexPath section]] withRowAnimation:UITableViewRowAnimationNone];
}];
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