LITLightweightStore 0.1.2

LITLightweightStore 0.1.2

LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Aug 2018

Maintained by Dmitry Lobanov.

  • By
  • Dmitry Lobanov


[![CI Status]( Dmitry/LITLightweightStore.svg?style=flat)]( 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


  • Easy to use
  • Convenience setup

###What implemented?

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


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



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

pod "LITLightweightStore"


Import store into your project, just add

// or
@import LITLightweightStore;


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];


[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];


Lobanov Dmitry, [email protected]


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