NKCache 1.0.0

NKCache 1.0.0

Maintained by Nikhil Sharma.



NKCache 1.0.0

  • By
  • Name

NKCache

Swift Version License CocoaPods Compatible
Platform

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

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 – @YourTwitter[email protected]

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

https://github.com/yourname/github-link