iOS 图片缓存库 GDRSImageCache

码农软件 · 软件分类 · 图像(Image) · 2019-05-31 08:28:28

软件介绍

GDRSImageCache 是 iOS 一个非常小型的图片缓存和更改图片大小的开发包。给定一个 URL 后该库会通过后台线程获取图片并在内存中缓存。

使用方法:

UIImageView *anImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];

// create the cache
GDRSImageCache *cache = [[GDRSImageCache alloc] initWithCachedImageFilter:^UIImage *(UIImage *sourceImage) {

    // resize the image to the image view size and round the image corners; 
    // this is called by the cache on a background thread
    return [sourceImage gdrs_resizedImageToAspectFitSize:anImageView.bounds.size cornerRadius:10];

}];

// set the default image, which will be returned from
// fetchImageWithURL:completionHandler: if an image coresponding to the
// requested url is not cached yet.
cache.defaultImage = [UIImage imageNamed:<#place holder image name#>];


NSURL *imageUrl = <#an url to a image#>;

// fetch an image; the call returns imidiatly and the callback handler
// is called when the image is fetched over the network
anImageView.image = [cache fetchImageWithURL:imageUrl completionHandler:^(UIImage *image, NSError *error) {
    anImageView.image = image;
}];

本文地址:https://codercto.com/soft/d/6926.html

重新理解创业

重新理解创业

周航 / 中信出版集团 / 2018-10-20 / 58.00

易到用车创始人/顺为资本投资合伙人周航,首度复盘20年创业经历,全方位坦陈创业得与失。这不是一本创业成功手册,却是思想的一次出走。 20年创业经历的咀嚼与反思,从战略、品牌、竞争,到流量、领导力、团队管理等,多角度多维度的重新认知,如李开复所言,“都是真刀真枪打出来的经验,值得每一位创业者多读几遍,吸收内化”。 雷军、李开复、徐小平作序,梁建章、张志东、曾鸣推荐。一起来看看 《重新理解创业》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具