Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/furqanmk/miva
A Swift Download Library
https://github.com/furqanmk/miva
cocoapods download-manager ios json miva swift
Last synced: 2 days ago
JSON representation
A Swift Download Library
- Host: GitHub
- URL: https://github.com/furqanmk/miva
- Owner: furqanmk
- License: mit
- Created: 2017-05-16T01:12:34.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-27T10:59:26.000Z (over 6 years ago)
- Last Synced: 2024-11-12T13:02:38.622Z (3 days ago)
- Topics: cocoapods, download-manager, ios, json, miva, swift
- Language: Swift
- Size: 108 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Miva
##### A Swift Download LibraryMiva is a networking image library that fetches, caches, and displays images, JSON, files via HTTP in Swift.
## Features
- 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## Example
First thing is to import the framework.
```swift
import Miva
```Once imported, you can start requesting images.
```swift
//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
})
```## Downloading JSON using Miva
Take advantage of the Generic nature of the library
```swift
MivaRequest(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
})
```## Cancel Request
Fetch requests can be cancelled when needed. This simply causes the closures not to be called.
```swift
request.cancel()
```## Requirements
Requires at least iOS 8 or above.
## Installation
#### CocoaPods
Miva requires CocoaPods 1.1.x or higher.
Miva is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile:
```
pod 'Miva'
```## TODOs
- Class and method documentation
- Improve design pattern
- Write test cases## License
Miva is licensed under MIT Open source license.
## Contact
### Furqan Muhammad Khan
* https://github.com/furqanmk
* http://twitter.com/furqanmk9
* http://behance.net/furqanmk