Latest 0.1.2
Homepage https://github.com/LightweightInTouch/LITLightweightStore
License MIT
Platforms ios 7.0, osx 10.9, requires ARC
Dependencies UICKeyChainStore
Frameworks Foundation, SystemConfiguration, Security
Authors

[![CI Status](http://img.shields.io/travis/Lobanov Dmitry/LITLightweightStore.svg?style=flat)](https://travis-ci.org/Lobanov Dmitry/LITLightweightStore)
Version
License
Platform

This is a lightweight key-value store which could be useful if you have several settings in app and you don’t know where you should place them

Requirements

iOS 7 or later

Features

  • Easy to use
  • Convenience setup

What implemented?

  • in-Memory dictionary store
  • Defaults store
  • Keychain store ( UICKeyChainStore inside
    )
  • Policy switching (move your data between stores)

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

LITLightweightStore is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "LITLightweightStore"

Import

Import store into your project, just add

#import<LITLightweightStore/LITLightweightStore.h>
// or
@import LITLightweightStore;

Examples

Storing device Id

Suppose, that you have sensitive data or settings.
Suppose, that you need a device id that you generated by yourself or you need first-user-install option.

Let’s see example:

# put device id 
NSString *deviceId = @"deviceId"; // please, use not so obvious name, of course.

// setup store in memory
LITLightweightStore *store = 
[LITLightweightStore storeWithPolicy:LITLightweightStorePolicyMemory options:@{LITLightweightStoreOptionsStoreScopeNameKey: @"app_settings", LITLightweightStoreOptionsAllFieldsArrayKey: deviceId}];

[store setField:deviceId byValue:@"YOUR_DEVICE_ID"];

// and if you go to release:
[store switchPolicy:LITLightweightStorePolicyDefaults];

// or more long-live:
[store switchPolicy:LITLightweightStorePolicyKeychain];

Cleanup

[store tearDown]; // cleanup store

[store setField:deviceId byValue:nil]; // cleanup value for field +deviceId+

Switch policy

LITLightweightStore *newStore = [store switchPolicy:LITLightweightStorePolicyDefaults];
LITLightweightStore *newStore = [store switchPolicy:LITLightweightStorePolicyKeychain];

Author

Lobanov Dmitry, [email protected]

License

LITLightweightStore is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "LITLightweightStore",
    "version": "0.1.2",
    "summary": "Lightweight key-value store which gives easy data access in memory, defaults and keychain domains.",
    "description": "If you don't know how to store settings of your app, you can use this lightstore for this task.nChoose correct policy and store items without pain.nAlso, you can switch policy very easy.",
    "homepage": "https://github.com/LightweightInTouch/LITLightweightStore",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Dmitry Lobanov": "[email protected]"
    },
    "platforms": {
        "ios": "7.0",
        "osx": "10.9"
    },
    "source": {
        "git": "https://github.com/LightweightInTouch/LITLightweightStore.git",
        "submodules": false,
        "tag": "0.1.2"
    },
    "source_files": "Pod/**/*.{h,m}",
    "exclude_files": "Example",
    "frameworks": [
        "Foundation",
        "SystemConfiguration",
        "Security"
    ],
    "requires_arc": true,
    "dependencies": {
        "UICKeyChainStore": []
    }
}

Pin It on Pinterest

Share This