I have a UITableView with custom UITableViewCells. Each cell asynchronously loads an image and displays it, this all works fine and the table view scrolls perfectly.
I have now added a “fade in” animation to the cell images, but this breaks the tables
scrolling. When I flick, as soon as an image wants to “fade in” the scroll animation of the tableview will stop dead. Almost as if the newly introduced ‘fade in’ on the cell images interrupts the scroll animation.
Is there any way to bypass this? is this common behavior, or have I managed to do something really weird?
Here is the callback function that gets called once the image is done loading asynchronously (the animation function).
-(void)imageReady:(UIImage *)image FromUrl:(NSString *)url
{
[UIView animateWithDuration:0.3 animations:^
{
[self.imageThumbnail setImage:image];
self.imageThumbnail.alpha = 1;
}];
}
I set the alpha to 0 at an earlier stage.
All help appreciated.
In my case, all it need was the “UIViewAnimationOptionAllowUserInteraction” option in the animateWithDuration call.