[self sd_setImageWithURL:[NSURL URLWithString:imageURL]
placeholderImage:placeholder
completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
if (image && cacheType == SDImageCacheTypeNone) {
CATransition *transition = [CATransition animation];
transition.type = kCATransitionFade;
transition.duration = 1;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
[weakself.layer addAnimation:transition forKey:nil];
}
}];
网友评论