I\'m using Alamofire, Objectmapper, Realm and everything is working beside one thing: I can\'t map nested objects.
class Voting: Object, Mappable {
dyna
You can extend ObjectMapper for Realm.List type with a operator function like as:
public func <- (left: List, right: Map) {
if right.mappingType == MappingType.FromJSON {
if let value = right.currentValue {
left.removeAll()
if let json = value as? [[String : AnyObject]] {
let objs = RealmS().add(T.self, json: json)
left.appendContentsOf(objs)
}
}
}
}
Try yourself.
ObjectMappper + Realm List type