Latest 0.4.3
Homepage https://github.com/muukii/RealmDefaults
License MIT
Platforms ios 8.0, requires ARC
Dependencies RealmSwift
Authors

CI Status
Version
License
Platform

Usage

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

Requirements

Installation

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

pod "RealmDefaults"

Usage

public class RealmDefaults : RealmSwift.Object {

    public class func purge()

    public static func write(@noescape block: (Self) -> Void)

    public class func schemaVersion() -> UInt64

    public class func defaultsName() -> String

    public class func filePath() -> String

    public class func configuration() -> RealmSwift.Realm.Configuration
}

Create subclass of RealmDefaults.

import RealmDefaults

class MyAccount: RealmDefaults {

    dynamic var name: String?
    dynamic var age: Int = 0
    dynamic var phoneNumber: String?

    override class func schemaVersion() -> UInt64 {
        return 3
    }
}

Read & Write

MyAccount.write { account in
    account.name = "muukii"
    account.age = 25
    account.phoneNumber = "080-0000-0000"
}

print(MyAccount.instance.name) // -> muukii
print(MyAccount.instance.age) // 25
print(MyAccount.instance.phoneNumber) // 080-0000-0000

Author

muukii, [email protected]

License

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

Latest podspec

{
    "name": "RealmDefaults",
    "version": "0.4.3",
    "summary": "RealmDefaults is a Simple value store.",
    "description": "RealmDefaults is a Simple value store. Replacement for NSUserDefaults",
    "homepage": "https://github.com/muukii/RealmDefaults",
    "license": "MIT",
    "authors": {
        "muukii": "[email protected]"
    },
    "source": {
        "git": "https://github.com/muukii/RealmDefaults.git",
        "tag": "0.4.3"
    },
    "social_media_url": "https://twitter.com/muukii0803",
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "dependencies": {
        "RealmSwift": [
            "~> 1.0"
        ]
    }
}

Pin It on Pinterest

Share This