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

浪潮之巅(第三版)(上下册)

浪潮之巅(第三版)(上下册)

吴军 / 人民邮电出版社 / 2016-5 / 99.00元

一个企业的发展与崛起,绝非只是空有领导强人即可达成。任何的决策、同期的商业环境,都在都影响着企业的兴衰。《浪潮之巅》不只是一本历史书,除了讲述科技顶尖企业的发展规律,对于华尔街如何左右科技公司,以及金融风暴对科技产业的冲击,也多有着墨。此外,这本书也着力讲述很多尚在普及 或将要发生的,比如微博和云计算,以及对下一代互联网科技产业浪潮的判断和预测。因为在极度商业化的今天,科技的进步和商机是分不开的。......一起来看看 《浪潮之巅(第三版)(上下册)》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具