Giter Club home page Giter Club logo

imagecachingkit's Introduction

ImageCachingKit

Image Caching Library for iOS written in Swift 5, that uses the filesystem as caching storage.

DiskCache is a file system level cache, that act as a dictionary [String: UIImage]. It works with one sub directory of NSCachesDirectory: NSCachesDirectory/ImageCachingKit for storing the cached images. The cleaning of the cache is managed by the operating system.

Build using Swift 5, XCode 10.2, supports iOS 10.0+

Usage

Import the ImageCachingKit framework to your file.

import ImageCachingKit

Writing:

/// Saves image inside 'ImageCachingKit' subdirectory or throws `ImageCachingError` if error occured.
///
/// - Parameters:
/// - image: pass here the image that you want cached.
/// - key: pass here the key under which you want this image cached. (example: the image name).
/// - Throws: error in case the save operation fails.
ImageCachingKit.saveImage(_ image: UIImage, forKey key: String) throws

Reading:

/// Returns a cached image or nil if image can't be found or error occured.
///
/// - Parameter key: the key under which you have cached the image.
/// - Returns: the stored image, if found under this key.
ImageCachingKit.readImageForKey(_ key: String) -> UIImage?

Installation

Carthage Installation

  1. In your Cartfile add github "stoqn4opm/ImageCachingKit"
  2. Link the build framework with the target in your XCode project

For detailed instructions check the official Carthage guides here

Manual Installation

  1. Download the project and build the shared target called ImageCachingKit
  2. Add the product in the list of "embed frameworks" list inside your project's target or create a work space with ImageCachingKit and your project and link directly the product of ImageCachingKit's target to your target "embed frameworks" list

Licence

The framework is licensed under MIT licence. For more information see file LICENCE

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.