https://github.com/hiroraba/codablenscache
Simple Wrapper NSCache for Codable Protocol
https://github.com/hiroraba/codablenscache
carthage cocoapods codable nscache swift4 wrapper-nscache
Last synced: 4 months ago
JSON representation
Simple Wrapper NSCache for Codable Protocol
- Host: GitHub
- URL: https://github.com/hiroraba/codablenscache
- Owner: hiroraba
- License: mit
- Created: 2017-11-28T15:01:50.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-29T15:13:42.000Z (over 7 years ago)
- Last Synced: 2025-03-13T15:16:48.775Z (4 months ago)
- Topics: carthage, cocoapods, codable, nscache, swift4, wrapper-nscache
- Language: Swift
- Homepage:
- Size: 19.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CodableNSCache
[](https://travis-ci.org/hiroraba/CodableNSCache)



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