Skip to content

Using Mapper to Parse JSON in Swift

eng.lyft.com
19 pointsSmileyKeith4 comments
On HN

Comments

Why would someone use mapper over SwiftyJSON?

One really nice benefit is that you don't have to duplicate any type information. Once you define your model with the data types you expect, mapper infers those types and converts the JSON values accordingly. It seems like with SwiftyJSON (which I haven't used) you have to duplicate this by calling things like `.stringValue` etc.

Interesting, i'll have to give it a shot to see how it works. Any plans to provide integrations for something like alamofire? If I could abstract all of the work to a special response handler i'd definitely switch over

really nice!!!

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.