Popularity
1.2
Stable
Activity
3.5
-
27
1
7

Code Quality Rank: L5
Programming language: Swift
License: MIT License
Tags: Database    
Latest version: v1.1.1

OneStore alternatives and similar libraries

Based on the "Database" category.
Alternatively, view OneStore alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of OneStore or a related project?

Add another 'Database' Library

README

OneStore

CI Status Version License Platform Carthage compatible

A single value proxy for NSUserDefaults, with clean API.

With OneStoreโ€ฆ

  • Create one proxy(an OneStore object) for each NSUserDefaults value.
  • Multiple NSUserDefaults and namespaces are supported with Stacks.

Example

Basic

let name = OneStore<String>("name")
let age = OneStore<Int>("age")

name.value = "muukii"
age.value = 18

Specify Stack

let stack = Stack(userDefaults: NSUserDefaults(suiteName: "group.me.muukii.Fil")!, namespace: "me")
let name = OneStore<String>("name", stack: stack)
let age = OneStore<Int>("age", stack: stack)

name.value = "muukii"
age.value = 18

Remove object

let name = OneStore<String>("name", stack: stack)
name.value = nil

Remove all objects on namespace


let stack = Stack(userDefaults: NSUserDefaults.standardUserDefaults(), namespace: "me")
let name = OneStore<String>("name", stack: stack)

stack.removeAllObjectsOnNamespace()
/* or */
name.stack.removeAllObjectsOnNamespace()

Realworld example


enum Me {

    static let name = OneStore<String>("name", stack: Me.stack)
    static let age = OneStore<Int>("age", stack: Me.stack)

    private static let stack = Stack(userDefaults: NSUserDefaults.standardUserDefaults(), namespace: "me")
}

Me.name.value = "muukii"

Requirements

Swift 3.0

Installation

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

pod "OneStore"

Author

muukii, [email protected]

License

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


*Note that all licence references and agreements mentioned in the OneStore README section above are relevant to that project's source code only.