Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 1 month 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 (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-29T15:13:42.000Z (about 7 years ago)
- Last Synced: 2024-11-16T23:45:48.365Z (about 1 month ago)
- Topics: carthage, cocoapods, codable, nscache, swift4, wrapper-nscache
- Language: Swift
- Homepage:
- Size: 19.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CodableNSCache
[![Build Status](https://travis-ci.org/hiroraba/CodableNSCache.svg?branch=master)](https://travis-ci.org/hiroraba/CodableNSCache)
![Languages](https://img.shields.io/badge/languages-Swift%203.2-orange.svg)
![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-green.svg?style=flat)
![Cocoapods compatible](https://img.shields.io/badge/Cocoapods-compatible-red.svg)
![License](https://img.shields.io/badge/license-MIT-blue.svg)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.