Latest 1.0.3
Homepage https://github.com/DragonCherry/LocalStorage
License MIT
Platforms ios 8.0
Dependencies TinyLog, SwiftKeychainWrapper, OptionalTypes
Authors

Save and load client-side local value in archived file.

Example

// Create a singleton with file name, which is a key for LocalStorage.
class SharedPreference {
    static let `default` = { return LocalStorage(fileName: "preference.db", directoryType: .libraryDirectory) }()
    private init() {}
}

// Save your value or object
SharedPreference.default.save("TEST_STRING", forKey: "MY_STRING_KEY")
SharedPreference.default.save(["TEST_KEY": "TEST_VALUE"], forKey: "MY_DICTIONARY_KEY")
SharedPreference.default.save([100, 10, 1], forKey: "MY_ARRAY_KEY")

// Load saved value or object
print("(SharedPreference.default.load("MY_STRING_KEY").debugDescription)")
print("(SharedPreference.default.load("MY_DICTIONARY_KEY").debugDescription)")
print("(SharedPreference.default.load("MY_ARRAY_KEY").debugDescription)")

Installation

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

pod "LocalStorage"

Unlicense

Do whatever you want with this code.

Latest podspec

{
    "name": "LocalStorage",
    "version": "1.0.3",
    "summary": "A simple utility class for saving values at local storage.",
    "description": "TODO: Add long description of the pod here.",
    "homepage": "https://github.com/DragonCherry/LocalStorage",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "DragonCherry": "[email protected]"
    },
    "source": {
        "git": "https://github.com/DragonCherry/LocalStorage.git",
        "tag": "1.0.3"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "LocalStorage/Classes/**/*",
    "dependencies": {
        "TinyLog": [],
        "SwiftKeychainWrapper": [],
        "OptionalTypes": []
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This