Wrap is a Swift library from John Sundell easily encode Swift classes, structs or enums as JSON data.
The key advantage of Wrap is the simplicity, and for more advanced objects that may not have simple data types you can create custom keys, and key types.
This code snippet from the readme shows how one could encode a simple object:
let name: String
let age: Int
let user = User(name: "John", age: 28)
let dictionary: [String : AnyObject] = try Wrap(user)
This would produce the Dictionary with the data:
You can find Wrap on Github here.
A nice simple way to encode Swift data as JSON.
Submit A Resource
Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?
You can submit the url here.
The resources we feel will appeal to our readers the most will be posted on the front page.