Skip to content

Instantly share code, notes, and snippets.

@kmkrn
Last active December 29, 2017 23:37
Show Gist options
  • Save kmkrn/5765aeb665f7053a109956b57df8639c to your computer and use it in GitHub Desktop.
Save kmkrn/5765aeb665f7053a109956b57df8639c to your computer and use it in GitHub Desktop.
import Foundation
import Realm
import RealmSwift
class Cat: Object, Decodable {
@objc dynamic var catId: Int = 0
@objc dynamic var name: String = ""
@objc dynamic var breed: String = ""
@objc dynamic var weight: Double = 0
override static func primaryKey() -> String? {
return "catId"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment