execute custom block _before_ setting image
This is particularly useful if you want to animate the image change, e.g. with a core animation block - that's not possible after image is changed.
This commit is contained in:
parent
bd6fc88c01
commit
908d77aaaf
@ -109,15 +109,15 @@ static NSString * const kUIImageViewImageRequestObjectKey = @"imageRequestOperat
|
||||
|
||||
self.imageRequestOperation = [AFImageRequestOperation operationWithRequest:request imageSize:imageSize options:options success:^(UIImage *image) {
|
||||
if (self.imageRequestOperation && ![self.imageRequestOperation isCancelled]) {
|
||||
if (block) {
|
||||
block(image);
|
||||
}
|
||||
|
||||
if ([[request URL] isEqual:[[self.imageRequestOperation request] URL]]) {
|
||||
self.image = image;
|
||||
} else {
|
||||
self.image = placeholderImage;
|
||||
}
|
||||
|
||||
if (block) {
|
||||
block(image);
|
||||
}
|
||||
}
|
||||
}
|
||||
}];
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user