swift - AlamofireObjectMapper: How can I handle a case where I need to handle same value with different keys? -


following scenario want achieve same value mapped different keys.

class user:mappable {     dynamic var name:string?     dynamic var players:list<players>()      func mapping(map: map) {         name <- map["name"] //this "name" key can "friends" in  scenario need map same player object .         players <- (map["players"] ,listtransform<player>())     } } 

how can achieve using alamofireobjectmapper. in case:

class player:mappable {     var name:string?     func mapping(map: map) {        name <- map["friendname"] //this key can "name" in scenarios need map same variable.     } } 


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -