Latest 1.1.0
Homepage https://github.com/lyandy/AndyStore
License MIT
Platforms ios 7.0, requires ARC
Dependencies AndyExtension
Frameworks Foundation
Authors

use json、NSDictionary and NSUserDefaults to store、read、delete and clear data easily

Use in pod: pod ‘AndyStore’

First of all

  • The AndyJsonStore Module is based on AndyExtension. Don’t worry, the AndyExtension core has been compiled in it. So the AndyStore is independent.

  • Any data you get from AndyStore, you should convert its type to the type that you want manually by yourself.(PS:the AndyJsonStore is an exception. It can convert data type automatically.)

There are three main methods paragraph

一、AndyJsonStore

In the module, it supports all Object-C types. It store data permanently.So everytime and everywhere in app, you can access you data easily.

Four methods:

- (BOOL)setOrUpdateValue:(id)value ForKey:(NSString *)key;

- (instancetype)getValueForClass:(Class)valueClass ForKey:(NSString *)key DefaultValue:(id)defaultValue ;

- (BOOL)removeValueForKey:(NSString *)key;

- (BOOL)clear;

二、AndyDictStore

Just like AndyJsonStore, it also supports all Object-C types. But it stores data temporarily. Once your app is closed , the data it stores will be destoryed. Since it’s builded based on NSDictionary.

Four methods:

- (BOOL)setOrUpdateValue:(id)value ForKey:(NSString *)key;

- (instancetype)getValueForKey:(NSString *)key DefaultValue:(id)defaultValue ;

- (BOOL)removeValueForKey:(NSString *)key;

- (BOOL)clear;

三、AndyUserDefaultsStore

This Module is a little sepcial. Since it just supports the baseic Object-C types like NSNumber、NSInteger etc. Just like AndyDictStore, it stores data temporarily.

Four methods:

- (BOOL)setOrUpdateValue:(id)value ForKey:(NSString *)key;

- (instancetype)getValueForKey:(NSString *)key DefaultValue:(id)defaultValue ;

- (BOOL)removeValueForKey:(NSString *)key;

- (BOOL)clear;


The last:

Before you run, you need pod install first. :)

The version is 1.1.0

There are a lot of experience to improve

If you are also interest on it, just pull request

Latest podspec

{
    "name": "AndyStore",
    "version": "1.1.0",
    "summary": "Use jsonu3001NSDictionary and NSUserDefaults to storeu3001readu3001delete and clear data easily",
    "description": "The AndyJsonStore Module is based on AndyExtension. Don't worry, the AndyExtension core has been compiled in it. So the AndyStore is independent.nnAny data you get from AndyStore, you should convert its type to the type that you want manually by yourself.uff08PS:the AndyJsonStore is an exception. It can convert data type automatically.uff09",
    "homepage": "https://github.com/lyandy/AndyStore",
    "license": "MIT",
    "authors": {
        "u674eu626c": "[email protected]"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/lyandy/AndyStore.git",
        "tag": "1.1.0"
    },
    "source_files": "AndyStore/*",
    "frameworks": "Foundation",
    "requires_arc": true,
    "dependencies": {
        "AndyExtension": [
            "~> 1.0.7"
        ]
    }
}

Pin It on Pinterest

Share This