CMDataStorage 1.4.0

CMDataStorage 1.4.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Unclaimed.


Downloads

Total36,548
Week0
Month2,293

Installs

Apps106
Test Targets3
powered by Segment

GitHub

Stars30
Watchers3
Forks1
Issues0
Contributors2
Pull Requests0

Code

Files2
LOCLines of Code 220


  • By
  • Constantine Mureev

License MIT

Simple and powerful API to work with NSData in IOS Cache, Documents and Temp folder.

Features

  • Extremely simple implementation and powerful API
  • Separated GCD queues
  • Callbacks based on blocks
  • Safe file naming using MD5
  • Using modern NSURL iOS API for file paths
  • 100% bugs free. (Used in many projects)

Example Usage

Async save NSData in iOS Documents folder

NSString *uniqueKey = @"unique name";
[CMDataStorage.sharedDocumentsStorage storeData:data key:uniqueKey block:^(BOOL succeeds) {
    //
}];

Async save NSData in iOS Cache folder

NSString *uniqueKey = @"unique name";
[CMDataStorage.sharedCacheStorage storeData:data key:uniqueKey block:^(BOOL succeeds) {
    //
}];

Async read NSData from iOS Cache folder

NSString *uniqueKey = @"unique name";
[CMDataStorage.sharedCacheStorage dataForKey:uniqueKey block:^(NSData *data) {
    //
}];

Sync read NSData from iOS Documents folder

NSString *uniqueKey = @"unique name";
NSData *data = [CMDataStorage.sharedDocumentsStorage dataForKey:uniqueKey];

License

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