我遷移到AFNetworking 2 什麼是更換AFNetworking 2遷移imageProcessingBlock:
[AFImageRequestOperation imageRequestOperationWithRequest:request imageProcessingBlock:
^UIImage *(UIImage *downloadedImage) {
return [NIImageProcessing imageFromSource:downloadedImage
withContentMode:contentMode
cropRect:cropRect
displaySize:displaySize
scaleOptions:self.scaleOptions
interpolationQuality:self.interpolationQuality];
} success:^(NSURLRequest *successfulRequest, NSHTTPURLResponse *response, UIImage *processedImage) {
[self _didFinishLoadingWithImage:processedImage
cacheIdentifier:pathToNetworkImage
displaySize:displaySize
contentMode:contentMode
scaleOptions:self.scaleOptions
expirationDate:nil];
} failure:^(NSURLRequest *errorRequest, NSHTTPURLResponse *response, NSError *error) {
[self _didFailToLoadWithError:error];
}];
這是雨雲---> NINetworkImageView.m
請建議。
是的,我明白,但在哪裏放置imageProcessingBlock: – SanjayPathak
@ user3427687,我已經更新了答案。我沒有測試過,但我希望它沒有嚴重的錯誤。 – Avt
@ user3427687如果有用,請不要忘記接受/提出答案。 – Avt