Unboxing JSON with Unbox

John Sundell has put together a really handy Swift library called Unbox. It provides a straightforward interface for marshalling JSON data into Swift data models and it supports all the standard JSON types out of the box.

I like it better than the approach taken in ObjectMapper because Unbox supports immutable (let) properties whereas ObjectMapper currently requires all properties to be mutable. It does look like ObjectMapper is in the process of adding an ImmutableMapping protocol which should be a big improvement, but I think Unbox is probably the better choice right now.

Photo credit: Craig Sunter

Comments are closed.

Blog at WordPress.com.

Up ↑