Simple Wrapper NSCache for Codable Protocol
struct Person:Codable {
var name:String
var address:String
}
let cache = CodableCache<Person>()
let person = Person(name: "hiroraba", address: "kyoto")
cache.setObject(obj: person, forKey: "example")
let p = cache.objectForKey(forKey: "example")
print(p?.name) => "hiroraba"
- iOS 8.0+
- Swift3.2+
platform :ios, '8.0'
use_frameworks!
pod 'CodableNSCache'
Create a Cartfile
that lists the framework and run carthage update
. Follow the instructions to add $(SRCROOT)/Carthage/Build/iOS/CodableNSCache.framework
to an iOS project.
github "hiroraba/CodableNSCache"
- Download and drop
CodableNSCache.swift
in your project. - Congratulations!
We would love you for the contribution, check the LICENSE
file for more info.