Latest 0.1.2
Homepage https://github.com/maxsokolov/swift-objectstorage
License MIT
Platforms ios 8.0, requires ARC
Dependencies Valet
Frameworks Foundation
Authors

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.

Latest podspec

{
    "name": "ObjectStorage",
    "version": "0.1.2",
    "homepage": "https://github.com/maxsokolov/swift-objectstorage",
    "summary": "A lightweight key/value wrapper for user defaults, keychain and file storage with common interface",
    "authors": {
        "Max Sokolov": "[email protected]"
    },
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "ObjectStorage",
    "module_name": "ObjectStorage",
    "source": {
        "git": "https://github.com/maxsokolov/swift-objectstorage.git",
        "tag": "0.1.2"
    },
    "requires_arc": true,
    "frameworks": "Foundation",
    "dependencies": {
        "Valet": [
            "~> 1.0"
        ]
    }
}

Pin It on Pinterest

Share This