I\'m new to swift and realm. I want to make a composite primary key and when I\'m trying something like this :
class DbLocation : Object {
dynamic var id =
For latest version of Swift and Realm, I would do something like this.
dynamic private var compoundKey: String = ""
required convenience init?(map: Map) {
self.init()
if let firstValue = map.JSON["firstValue"] as? String,
let secondValue = map.JSON["secondValue"] as? Int {
compoundKey = firstValue + "|someStringToDistinguish|" + "\(secondValue)"
}
}