Latest 0.1.0
Homepage https://github.com/ssh88/ImageCacheable
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

Usage

First conform to the protocol

struct MyObject: ImageCacheable {

To use the in-memory cache call:

inMemoryImage(forKey: "uniqueImageID", from: imageURL) { (image, key) in

}

If the image does not already exist, it will download the image from the specified url, and store it a a Swift Cache, but wont persist across sessions.

Alternatively you can persist images to disk and across sessions by calling:

localImage(forKey: "uniqueImageID", from: imageURL) { (image, key) in

}

To clear the cache, call either of the following functions, depending on if your using the in-memory cache or local file storage

clearInMemoryCache(success: (Bool) -> Void)
clearLocalCache(success: (Bool) -> Void)

Requirements

  • iOS 9.0+
  • Swift 3
  • Xcode 8

Installation

ImageCacheable is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "ImageCacheable"

Author

ssh88, [email protected]

License

ImageCacheable is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "ImageCacheable",
    "version": "0.1.0",
    "summary": "Swift protocol to save images locally or cache in memory",
    "description": "Swift protocol to allow any object to easily save & retrieve a UIImage from local storage or in memory cache.",
    "homepage": "https://github.com/ssh88/ImageCacheable",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Shabeer Hussain": "[email protected]"
    },
    "source": {
        "git": "https://github.com/ssh88/ImageCacheable.git",
        "tag": "0.1.0"
    },
    "social_media_url": "https://twitter.com/sshdeveloper",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "ImageCacheable/Classes/**/*",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This