简体   繁体   English

我是否需要在UICollectionView中包含整个SDWebImage库才能进行图像下载?

[英]Do I need to include entire SDWebImage library for image downloading in UICollectionView?

I want to use the "SDWebImage" library in my iOS application in which I am using an UICollectionView to display a number of images. 我想在我的iOS应用程序中使用“ SDWebImage”库,在其中我使用UICollectionView来显示许多图像。

Do I need to add all the files from SDWebImage library to my project? 我是否需要将SDWebImage库中的所有文件添加到我的项目中? I learnt that I just need to import the UIImageview+webcache category in my view controller to start the image download. 我了解到,我只需要在视图控制器中导入UIImageview + webcache类别即可开始下载图像。 Please give your inputs. 请输入您的意见。

The best practice would be to install it through Cocoapods: https://github.com/rs/SDWebImage#installation-with-cocoapods 最佳做法是通过Cocoapods安装它: https : //github.com/rs/SDWebImage#installation-with-cocoapods

That way, you won't have to worry about dependencies and you will just need to use 这样,您就不必担心依赖关系,只需要使用

#import <SDWebImage/UIImageView+WebCache.h>

anywhere you need it 任何需要的地方

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM