TestsTested | ✓ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Aug 2016 |
SPMSupports SPM | ✓ |
Maintained by muukii, muukii0803, muukii.
To run the example project, clone the repo, and run pod install
from the Example directory first.
RealmDefaults is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "RealmDefaults"
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
}
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
}
}
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
muukii, [email protected]
RealmDefaults is available under the MIT license. See the LICENSE file for more info.