Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/comquas/cqimagedownloader
Simple Image Downloader for UIImageView
https://github.com/comquas/cqimagedownloader
swift
Last synced: 25 days ago
JSON representation
Simple Image Downloader for UIImageView
- Host: GitHub
- URL: https://github.com/comquas/cqimagedownloader
- Owner: comquas
- License: mit
- Created: 2016-07-21T02:59:12.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-12-13T09:51:04.000Z (about 8 years ago)
- Last Synced: 2024-12-21T23:33:18.277Z (about 1 month ago)
- Topics: swift
- Language: Swift
- Size: 63.5 KB
- Stars: 2
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## With CocoaPod
add
```
pod "CQImageDownloader"
```## Manual
copy to `CQImageDownloader/Classes/CQImageDownloader.swift` to your project.
## Usage
### Download and Show
```swift
imageView.setCQImage("https://unsplash.com/photos/BO5BswJwguI/download?force=true")
``````swift
imageView.setCQImage("https://unsplash.com/photos/BO5BswJwguI/download?force=true", placeholder: placeholderImage)
```### Downloading with progress
```swift
imageView.setCQImage("https://unsplash.com/photos/BO5BswJwguI/download?force=true", placeholder: nil, progress: { (value: Float) in//supporting progress
print(value)
})```
### Downloading with completion
```swift
imageView.setCQImage("https://unsplash.com/photos/BO5BswJwguI/download?force=true", placeholder: nil, progress: nil, completion: { (image:UIImage?, success:Bool) inif (success) {
}
})
```### Clear Cache
```swift
CQImageDownloader.clearAllTheCachedImages()
``````swift
var downloader = CQImageDownloader()
downloader.deleteCacheImage("file URL")
```