ObjectStorage 0.1.2

ObjectStorage 0.1.2

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Jul 2015
SPMSupports SPM

Maintained by Max Sokolov.



  • By
  • Max Sokolov

ObjectStorage

A lightweight key/value wrapper for user defaults, keychain and file storage with common interface

Using the ObjectStorage

Simply add objects to an appropriate storage.

ObjectStorage.defaults().setObject(user, forKey: "user")  // NSUserDefaults
ObjectStorage.keychain().setObject(user, forKey: "user")  // Keychain
ObjectStorage.localFile().setObject(user, forKey: "user") // Serialize object and save to the Documents dir

Get objects same way.

var user = ObjectStorage.keychain().objectForKey("user") as? User

Installation

Using CocoaPods:

use_frameworks!
pod 'ObjectStorage'

Manually:

Simply add all files from the ObjectStorage dir to your xcode project.

Requirements

  • iOS 8.0+
  • Xcode 6.3

Todo

Full test coverage.

License

MIT license. See the LICENSE file for more information.