Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ashfurrow/afimagedownloader
Downloads JPEG images asynchronously and decompresses them on a background thread.
https://github.com/ashfurrow/afimagedownloader
Last synced: about 2 months ago
JSON representation
Downloads JPEG images asynchronously and decompresses them on a background thread.
- Host: GitHub
- URL: https://github.com/ashfurrow/afimagedownloader
- Owner: ashfurrow
- License: mit
- Created: 2013-01-16T13:15:43.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2015-09-18T21:02:23.000Z (over 9 years ago)
- Last Synced: 2024-03-14T22:09:35.113Z (10 months ago)
- Language: Objective-C
- Size: 395 KB
- Stars: 88
- Watchers: 7
- Forks: 14
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## AFImageDownloader
A simple image downloader for iOS. Still working on completing it. It's a personal side project and challenge I'm working on: can I develop a small library that will fetch and decompress JPEGs efficiently completely using Behaviour-Driven Development with [Kiwi](https://github.com/allending/Kiwi)? I didn't let the app touch the Internet until it was completely done. The first time I ran it, it worked.Downloads JPEG images asynchronously and decompresses them on a background thread.
## Usage
Import the following four files into your project. `#import` the `AFImageDownloader.h` file and you're good to go!
- `AFImageDownloader.h`
- `AFImageDownloader.m`
- `NSData+AFDecompression.h`
- `NSData+AFDecompression.m`Usage is pretty simple:
[AFImageDownloader imageDownloaderWithURLString:@"http://static.ashfurrow.com.s3.amazonaws.com/github/worked.jpg" autoStart:YES completion:^(UIImage *decompressedImage) {
self.imageView.image = decompressedImage;
}];It's a "fire and forget" class, so you don't need to worry about retaining a strong reference to it. It will deallocate its own memory when its completed or cancelled.
## Testing
Make sure to do a recursive checkout to get the [Kiwi](https://github.com/allending/Kiwi) testing frameworking.
git checkout --recursive git://github.com/AshFurrow/AFImageDownloader.git