SDWebImage前世今生之V2.1版本

2.1版本2010年6月12日发布

1. UIImageView+WebCache 新增取消图片加载

@interface UIImageView (WebCache) <SDWebImageManagerDelegate>

- (void)setImageWithURL:(NSURL *)url;
- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder;

//----------------------2.1版本更新-新增-取消图片加载--------------------
- (void)cancelCurrentImageLoad;
//------------------------------end----------------------------------

@end
//-----------------------2.1版本更新-取消图片加载-----------------------
- (void)cancelCurrentImageLoad{
    [[SDWebImageManager sharedManager] cancelForDelegate:self];
}
//------------------------------end----------------------------------

2. SDImageCache 缓存器做了优化,兼容iPhone4增加了宏定义

        //-----------------------2.1版本更新-系统版本兼容宏定义-----------------------
        #ifdef __IPHONE_4_0
        UIDevice *device = [UIDevice currentDevice];
        if ([device respondsToSelector:@selector(isMultitaskingSupported)] && device.multitaskingSupported){
            [[NSNotificationCenter defaultCenter] addObserver:self
                                                     selector:@selector(clearMemory)
                                                         name:UIApplicationDidEnterBackgroundNotification
                                                       object:nil];
        }
        #endif
        //--------------------------------end--------------------------------
    }
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容