美文网首页Mac OS开发MAC 开发
MAC 开发 - 使用SDWebImage

MAC 开发 - 使用SDWebImage

作者: _哼哼_ | 来源:发表于2017-08-16 10:23 被阅读18次

MAC 开发 - 使用SDWebImage

最新版SDWebImage 已经支持 MAC ,但是需要把 UIImage , UIImageView 转换成 NSImage, NSImageView.

#import <TargetConditionals.h>
#if !TARGET_OS_IPHONE
#import <AppKit/AppKit.h>
#ifndef UIImage
#define UIImage NSImage
#endif
#ifndef UIImageView
#define UIImageView NSImageView
#endif
#else
#import <UIKit/UIKit.h>
#endif

其实原理就是 把 sdk中定义的 UIImage UIImageView 定义成 一个宏了,所以在 使用之前 先把上边的宏定义好.

相关文章

网友评论

    本文标题:MAC 开发 - 使用SDWebImage

    本文链接:https://www.haomeiwen.com/subject/mwabrxtx.html