分享最热门的资讯
SDWebImage是iOS中一款处理图片的框架, 使用它提供的方法, 一句话就能让UIImageView,自动去加载并显示网络图片,将图片缓存到内存或磁盘缓存,正好有阅读开源项目的计划,于是首选SDWebImage,本文向大家分享项目整体框架以及最基本相关的GCD与Block等相关知识和基本方法使用,以及设计的思想。
SDWebImage图片缓存框架,最常用的是使用UItableViewCell使用UIImageView的来下载的图片并缓存,功能官方的解释是这样的
This library provides a category for UIImageView with support for remote images coming from the web.*
SDImageView提供UIImageView、UIImage等分类支持从远程服务器下载并缓存图片
提供的功能如下:
AnUIImageViewcategory adding web image and cache management to the Cocoa Touch framework 一个带有管理网络图片下载和缓存的UIImageView类别
An asynchronous image downloader 一个异步图片下载器
An asynchronous memory + disk image caching with automatic cache expiration handling 一个提供内存和磁盘缓存图片,并且能够自动清理过期的缓存
Animated GIF support (支持GIF图片)
WebP format support 支持WebP
A background image decompression 图片后台解压图片(空间换时间,这种做法会使内存激增,所以SD中含有**图片是否解压的参数)
A guarantee that the same URL won't be downloaded several times 保证一个URL不会下载多次
A guarantee that bogus URLs won't be retried again and again 保证黑名单的URL不会返回加载
A guarantee that main thread will never be blocked 保证主线程不会堵塞
Performances! 高性能
Use GCD and ARC 使用GCD和ARC
Arm64 support 支持Arm64
本文由 姬長信 创作,文章地址:https://blog.isoyu.com/archives/1556.html
采用知识共享署名4.0 国际许可协议进行许可。除注明转载/出处外,均为本站原创或翻译,转载前请务必署名。最后编辑时间为:11月 4, 2016 at 08:00 上午