tristanhimmelman/AlamofireObjectMapper

support to swift List Realm class

Closed this issue · 1 comments

Hi all,

We are developing with swift 2.0 and we're using alamofire 3.0, Realm 0.96, and your last version of ObjectMapper
We have some entities that inherits from Object (to persist in Realm) and implements Mappable protocol. We have the following classes

class A: Object, Mappable{

dynamic var name : String?
let productGroup = List()

required convenience init?(_ map: Map) {
self.init()
}

func mapping(map: Map) {
name <- map["name"]
productGroup <- map["productGroup"]

}

class ProductGroup: Mappable {
dynamic var name : String?
dynamic var urlPhoto : String?
dynamic var currency : String?

required convenience init?(_ map: Map) {
    self.init()
}

  func mapping(map: Map) {
       name <- map["name"]
       currency <- map["currency"]
       urlPhoto <- map["urlPhoto"]
  }

}
object A has a list of productGroup (supported by Realm to keep them persistently). When we parse them within the A class mapping, productGroup is not populated because is not entering to the ProductGroup mapping function.

Are you going to support nested objects using List?

Best regards,

Alfonso.

Hi there,
This issue should really be posted on the ObjectMapper page. I don't have plans at the moment to add support for Realm List objects, however others have created Custom transforms that can be used for this. Please search the ObjectMapper issues, you should find useful information there.

Tristan