如何删除UIView transitionWithView的效果

Ale*_*way 14 objective-c calayer uiview ios

使用下面的代码我成功地使我的UIImageView在其图像中淡入淡出.

[UIView transitionWithView:myCell.myImageView duration:2.0 options:UIViewAnimationOptionTransitionCrossDissolve animations:^{
    myCell.myImageView.image = myImage;
} completion:NULL];
Run Code Online (Sandbox Code Playgroud)

但是,当重复使用单元格时,我需要删除此图像.重复使用时,它显示最后一个图像(在重复使用之前显示),然后转换到它应该是的图像,而不是从没有图像过渡到它应该是的图像.

我尝试过的:

-(void)prepareForReuse {
    [super prepareForReuse];

// More is obviously needed than just setting image to nil when using a transition
self.myImageView.image = nil;

[self.myImageView setNeedsDisplay];

// but I also tried removing all animations
[self.myImageView.layer removeAllAnimations];

// and I even tried removing the sublayers, but still no success.
[self.myImageView.layer.sublayers makeObjectsPerformSelector:@selector(removeFromSuperlayer)];
}
Run Code Online (Sandbox Code Playgroud)

任何帮助表示赞赏,但如果您不明白问题是什么,请不要回答.反而评论,如果需要我可以更好地解释.

谢谢!

Ale*_*way 0

感谢您的尝试,但没有一个答案可以解决问题。我也尝试过不同答案的组合。此外,他们都不满足“从可信和/或官方来源寻找答案”。我已经联系了苹果开发者技术支持,当我收到他们的回复时,我会编辑这个答案,这样它也能帮助其他人。