Name: iOS-AssetsCaching
Owner: 3Pillar Global Open Source
Description: This framework aims to provide a light and easy to use way to retrieve and cache data files from a provided url.
Created: 2017-10-10 14:35:57.0
Updated: 2017-10-10 15:32:17.0
Pushed: 2017-10-10 15:50:11.0
Homepage: null
Size: 1088
Language: Swift
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This framework aims to provide an easy way to retrieve and cache data files from provided url.
Available in iOS 9.0 and later.
Run Terminal
git \"https://github.com/3pillarlabs/iOS-AssetsCaching.git\" \"master\" > Cartfile
hage update --no-use-binaries --platform iOS
rt AssetCaching
rt UIKit
rt AssetCaching
s ViewController: UIViewController {
@IBOutlet weak var imageView: UIImageView!
let assetManager: AssetManager = AssetManager()
override func viewDidLoad() {
super.viewDidLoad()
let urlString = "https://oceanservice.noaa.gov/facts/sealevel-global-local.jpg"
if let url = URL(string: urlString) {
if let asset = Asset(networkURL: url) {
assetManager.fetchAsset(asset, completion: {[weak self] (asset, error) in
if let url = asset.localURL, let image = UIImage(contentsOfFile: url.path) {
//Load the asset inside an image view
print(image.debugDescription)
self?.imageView.image = image
}
})
}
}
}
For a light demonstration check out “DemoApp” branch to observe functionality.
icense
set Caching** is released under MIT license. See [LICENSE](LICENSE) for details.
bout this project
Pillar Global](https://www.3pillarglobal.com/wp-content/themes/base/library/images/logo_3pg.png)](http://www.3pillarglobal.com/)
set Caching** is developed and maintained by [3Pillar Global](http://www.3pillarglobal.com/).