Miva is a networking image library that fetches, caches, and displays images, JSON, files via HTTP in Swift.
- In-memory caching.
- Nonblocking IO. All HTTP and disk IO happen in the background.
- Completely Generic.
- Simple one method UIImageView to load a remote image.
- Robust, fast, and customizable.
- Simple concise codebase.
- handles redundant image requests, so only one request is sent for multiple queries
First thing is to import the framework.
import Miva
Once imported, you can start requesting images.
//you can simply call the URL string on your UIImageView
let imageUrl = "https://assets-cdn.github.com/images/modules/logos_page/GitHub-Mark.png"
let imageView = UIImageView(frame: CGRectMake(0, 60, 200, 200))
self.imageView.setImage(url: imageUrl)
//fetch the image using the image manager
MivaImageManager.shared.fetch(url: url,
progress: { (part) in
//update your progress bars
}, success: { (image) in
//use your image
}, failure: { (error) in
//handle the error
})
Take advantage of the Generic nature of the library
MivaRequest<JSON>(path: "https://pastebin.com/raw/wgkJgazE",
progress: { (part) in
//update your progress bars
}, success: { (json) in
//use your json
}, failure: { (error) in
//handle the error
})
Fetch requests can be cancelled when needed. This simply causes the closures not to be called.
request.cancel()
Requires at least iOS 8 or above.
Miva requires CocoaPods 1.1.x or higher.
Miva is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'Miva'
- Class and method documentation
- Improve design pattern
- Write test cases
Miva is licensed under MIT Open source license.