Which Swift JSON library do you recommend?

Is there a JSON library that developers or CB recommend for working with iOS / Swift 4?

More specifically is there a library to help deal with data* that sync gateway delivers to iOS so that the JSON data can be quickly and easily serialised to classes/objects/enums etc?

*the not quite JSON and not quite Swift dictionary

We don’t recommend anything specific but I have personally liked Swift Codables for encoding / decoding from JSON/ Swift Objects. Of course you would still need to map the native objects (“POSO”) to Document types. This repo is a bit dated (a year ago) but the concepts should apply to latest swift version - feel free to submit a PR if you update it to latest :slight_smile:

1 Like

Thanks Priya. I’ll investigate this.


Plain Old Swift Object

We don’t expose JSON at all in our API, so I don’t think a Swift JSON library will be any help working with CBL.