Skip to content

Commit 23874cd

Browse files
committed
Update for #771 - instead of removing the old methods, deprecated them so we are backwards compatible.
1 parent 6d01e80 commit 23874cd

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

SDWebImage/UIButton+WebCache.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,4 +220,6 @@
220220
- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setBackgroundImageWithURL:forState:placeholderImage:completed:`");
221221
- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setBackgroundImageWithURL:forState:placeholderImage:options:completed:`");
222222

223+
- (void)cancelCurrentImageLoad __deprecated_msg("Use `cancelImageLoadForState:`");
224+
223225
@end

SDWebImage/UIButton+WebCache.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,4 +240,9 @@ - (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state pl
240240
}];
241241
}
242242

243+
- (void)cancelCurrentImageLoad {
244+
// in a backwards compatible manner, cancel for current state
245+
[self cancelImageLoadOperationWithKey:[NSString stringWithFormat:@"UIButtonImageOperation%@", @(self.state)]];
246+
}
247+
243248
@end

SDWebImage/UIImageView+WebCache.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,4 +173,6 @@
173173
- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:placeholderImage:options:completed:`");
174174
- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:placeholderImage:options:progress:completed:`");
175175

176+
- (void)cancelCurrentArrayLoad __deprecated_msg("Use `cancelCurrentAnimationImagesLoad`");
177+
176178
@end

SDWebImage/UIImageView+WebCache.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,4 +172,8 @@ - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder opt
172172

173173
}
174174

175+
- (void)cancelCurrentArrayLoad {
176+
[self cancelCurrentAnimationImagesLoad];
177+
}
178+
175179
@end

0 commit comments

Comments
 (0)