第一步:配置SDWebImage 打开github,https://github.com/rs/SDWebImage,将SDWebImage下载到本地 用Xcode创建一个swift的singleView项目,将SDWebImage拖动到项目中,如图: 点开项目属性的General,在Embedded Binaries中添加引用框架 编译程序,确保没有错误.由于该库是用oc写的,所以需要将其桥接到swift中.步骤是这样的: 在我们的项目中添加一个h文件,取名为“SDWebImage+Heade…
UIImage这个对象是swift中的图像类,可以使用UIImageView加载显示到View上. 以下是UIImage的构造函数: init(named name: String!) -> UIImage // load from main bundle init(named name: String!, inBundle bundle: NSBundle!, compatibleWithTraitCollection traitCollection: UITraitCollection!)…
SDWebImage ReadMe.md 文档 附:SDWebImage框架github下载地址:https://github.com/rs/SDWebImage 注1:该文章简单翻译了SDWebImage最新版本(3.8.1)的readMe.md,时间紧促,如有不当请指正修改,十分感激. 注2:对该框架的学习将持续进行,在个人的github地址可以得到最新进展. Web Image 版本3.8.1|平台iOS|开源协议MIT| 该库为UIImageView提供了一个分类来处理远程图片资源的加载…
SDWebImage ReadMe.md 文档 附:SDWebImage框架github下载地址:https://github.com/rs/SDWebImage注1:该文章简单翻译了SDWebImage最新版本(3.7.5)的readMe.md,时间紧促,如有不当请指正修改,十分感激.注2:对该框架的学习将持续进行,在个人的github地址可以得到最新进展. Web Image 版本3.7.5|平台iOS|开源协议MIT| 该库为UIImageView提供了一个分类来处理远程图片资源的加载.…
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 8…
/** * 获取远程图片的宽高和体积大小 * * @param string $url 远程图片的链接 * @param string $type 获取远程图片资源的方式, 默认为 curl 可选 fread * @param boolean $isGetFilesize 是否获取远程图片的体积大小, 默认false不获取, 设置为 true 时 $type 将强制为 fread * @return false|array */ function myGetImageSize($url, $ty…
/***获取远程图片的宽高和体积大小 ** @param string $url 远程图片的链接 * @param string $type 获取远程图片资源的方式, 默认为 curl 可选 fread * @param boolean $isGetFilesize 是否获取远程图片的体积大小, 默认false不获取, 设置为 true 时 $type 将强制为 fread * @return false|array*/function myGetImageSize($url, $type =…
Web image(网络图像) 该库提供了一个支持来自Web的远程图像的UIImageView类别它提供了: 添加网络图像和缓存管理到Cocoa Touch framework的UIImageView类别 异步图像下载 An asynchronous memory + disk image caching with automatic cache expiration handling 支持GIF动画 支持WebP格式 后台图像解压 保证相同的url不会下载多次 保证伪造的URL不会尝试一遍又一…
本地通知与远程通知详解 一:本地通知   Local Notification的作用 Local Notification(本地通知) :是根据本机状态做出的通知行为,因此,凡是仅需依赖本机状态即可判断需要发出通知的行为都可以或者说应该使用Local Notification来处理.比方说:iBeacon中进入了某个Beacon region,或者说自定义的一些定时提醒等. 构建Local Notification 在iOS中,构建LocalNotification非常简单,只需要掌握好NSLo…
SDWebImage使用——一个可管理远程图片加载的类库     SDWebImage使用——一个可管理远程图片加载的类库 SDWebImage托管在github上.https://github.com/rs/SDWebImage 这个类库提供一个UIImageView类别以支持加载来自网络的远程图片.具有缓存管理.异步下载.同一个URL下载次数控制和优化等特征. 将SDWebImage类库添加入工程时,一定注意需要添加MapKit.framework,如图所示,因为MKAnnotationVi…