ios - Using Swift Argo framework : Could not find an overload for '<*>' -


i using argo runes , box framework , have followed carthage way of adding frameworks. here model class cities

import argo import runes  struct cities {  let cityname: string let citystate: string   }  extension cities: decodable { static func create(cityname: string)(citystate: string!) -> cities {     return cities(cityname: cityname, citystate: citystate) }  static func decode(j: json) -> decoded<cities> {     return cities.create <*> j <| "cityname" <*> j <| "citystate"  } } 

i following error : not find overload '<*>' accepts supplied arguments @ return cities.create <*> j <| "cityname" <*> j <| "citystate"

how can fix issue?

sample json :

{"cityname":"panaji","citystate":"goa"} 

xcode: v6.4

after cities.create must put <^> operator

here modified code:

import argo import runes  struct cities {  let cityname: string let citystate: string   }  extension cities: decodable { static func create(cityname: string)(citystate: string!) -> cities {     return cities(cityname: cityname, citystate: citystate) }  static func decode(j: json) -> decoded<cities> {      return cities.create <^> j <| "cityname" // modified line                          <*> j <| "citystate"  } } 

in last version of argo that:

    import argo     import curry      struct cities {        let cityname: string        let citystate: string     }     extension cities: decodable {        static func decode(j: json) -> decoded<cities> {           return curry(cities.init)                <^> j <| "cityname"               <*> j <| "citystate"        }     } 

Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -