Created
April 15, 2018 21:35
-
-
Save own2pwn/ebefbb83b0231d5ea79158ef0a929398 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open class RealmModel: Object { | |
// MARK: - Properties | |
@objc dynamic var id: Int = nextID() | |
// MARK: - Internal | |
private static func nextID() -> Int { | |
return RealmService.shared.nextID(for: self) | |
} | |
// MARK: - Realm | |
open override class func primaryKey() -> String? { | |
return "id" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment