Latest 1.0.0
Homepage https://github.com/nikksindia/NKCache
License MIT
Platforms ios 9.0
Authors

Swift Version
License
CocoaPods Compatible
Platform

Simple on disk cache, backed by an NSCache in memory. It automatically purges itself when memory gets low.

NOTE: Data Model needs to implement 'Codable(Encodable&Decodable)' protocol to be saved on the cache.

Requirements

  • iOS 9.0+
  • Xcode 8.1

Installation

CocoaPods

You can use CocoaPods to install NKCache by adding it to your Podfile:

platform :ios, '9.0'
use_frameworks!
pod 'NKCache'

Manually

  1. Download and drop NKCache.swift in your project.
  2. Congratulations!

Usage

For adding/removing objects in cache:

func setObject<T:Codable>(_ object:T,forKey key:String)
func removeObjectForKey(_ key:String)
func removeAllObjects()

For fetching objects in cache:

func getObjectForKey<T:Codable>(_ key:String, completionHandler: @escaping (T?)->())
func objectExistsForKey(_ key:String)->Bool

Contribute

We would love you for the contribution to NKCache, check the LICENSE file for more info.

Meta

Nikhil Sharma – @devilnikks[email protected]

Distributed under the MIT license. See LICENSE for more information.

https://github.com/nikksindia

Latest podspec

{
    "name": "NKCache",
    "version": "1.0.0",
    "summary": "Simple on disk cache, backed by an NSCache in memory.",
    "homepage": "https://github.com/nikksindia/NKCache",
    "authors": {
        "Name": "[email protected]"
    },
    "license": {
        "type": "MIT",
        "file": "License"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/nikksindia/NKCache.git",
        "tag": "v1.0.0"
    },
    "source_files": "NKCache/*",
    "swift_version": "4.0"
}

Pin It on Pinterest

Share This