...
|
...
|
@@ -164,97 +164,3 @@ static char imageURLStorageKey; |
|
|
}
|
|
|
|
|
|
@end |
|
|
|
|
|
|
|
|
@implementation UIButton (WebCacheDeprecated)
|
|
|
|
|
|
- (NSURL *)currentImageURL {
|
|
|
return [self sd_currentImageURL];
|
|
|
}
|
|
|
|
|
|
- (NSURL *)imageURLForState:(UIControlState)state {
|
|
|
return [self sd_imageURLForState:state];
|
|
|
}
|
|
|
|
|
|
- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state {
|
|
|
[self sd_setImageWithURL:url forState:state placeholderImage:nil options:0 completed:nil];
|
|
|
}
|
|
|
|
|
|
- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder {
|
|
|
[self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:nil];
|
|
|
}
|
|
|
|
|
|
- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options {
|
|
|
[self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:options completed:nil];
|
|
|
}
|
|
|
|
|
|
- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDWebImageCompletedBlock)completedBlock {
|
|
|
[self sd_setImageWithURL:url forState:state placeholderImage:nil options:0 completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
|
|
|
if (completedBlock) {
|
|
|
completedBlock(image, error, cacheType);
|
|
|
}
|
|
|
}];
|
|
|
}
|
|
|
|
|
|
- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock {
|
|
|
[self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
|
|
|
if (completedBlock) {
|
|
|
completedBlock(image, error, cacheType);
|
|
|
}
|
|
|
}];
|
|
|
}
|
|
|
|
|
|
- (void)setImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock {
|
|
|
[self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:options completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
|
|
|
if (completedBlock) {
|
|
|
completedBlock(image, error, cacheType);
|
|
|
}
|
|
|
}];
|
|
|
}
|
|
|
|
|
|
- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state {
|
|
|
[self sd_setBackgroundImageWithURL:url forState:state placeholderImage:nil options:0 completed:nil];
|
|
|
}
|
|
|
|
|
|
- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder {
|
|
|
[self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:nil];
|
|
|
}
|
|
|
|
|
|
- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options {
|
|
|
[self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:options completed:nil];
|
|
|
}
|
|
|
|
|
|
- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDWebImageCompletedBlock)completedBlock {
|
|
|
[self sd_setBackgroundImageWithURL:url forState:state placeholderImage:nil options:0 completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
|
|
|
if (completedBlock) {
|
|
|
completedBlock(image, error, cacheType);
|
|
|
}
|
|
|
}];
|
|
|
}
|
|
|
|
|
|
- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock {
|
|
|
[self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
|
|
|
if (completedBlock) {
|
|
|
completedBlock(image, error, cacheType);
|
|
|
}
|
|
|
}];
|
|
|
}
|
|
|
|
|
|
- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock {
|
|
|
[self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:options completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
|
|
|
if (completedBlock) {
|
|
|
completedBlock(image, error, cacheType);
|
|
|
}
|
|
|
}];
|
|
|
}
|
|
|
|
|
|
- (void)cancelCurrentImageLoad {
|
|
|
// in a backwards compatible manner, cancel for current state
|
|
|
[self sd_cancelImageLoadForState:self.state];
|
|
|
}
|
|
|
|
|
|
- (void)cancelBackgroundImageLoadForState:(UIControlState)state {
|
|
|
[self sd_cancelBackgroundImageLoadForState:state];
|
|
|
}
|
|
|
|
|
|
@end |
...
|
...
|
|