/Jsonable

Swift classes to read and write JSON

Primary LanguageSwiftMIT LicenseMIT

Jsonable

Use Swift classes to read and write JSON.

Benefits

  • No special syntax required. Forget having to do ["property"]
  • No manual configuration, just inherit from Jsonable
  • Serialize/Deserialize to JSON text, dictionary, or console

Example

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()

Getting Started

Download the XCode project and run the demo.
To use in your own project copy files from JsonableFiles folder.

Requirements

XCode 6.1
iOS 8.1