Use Swift classes to read and write JSON.
- No special syntax required. Forget having to do ["property"]
- No manual configuration, just inherit from Jsonable
- Serialize/Deserialize to JSON text, dictionary, or console
class Photo : Jsonable {
var id: Int = 0
var title: String = ""
var url = NSURL()
}
var photo = Photo()
photo.id = 4
photo.title = "A day at the beach..."
photo.url = NSURL(string: "https://whitneyland.com/photo.jpg")!
photo.toJsonString()
Download the XCode project and run the demo.
To use in your own project copy files from JsonableFiles folder.
XCode 6.1
iOS 8.1