Skip to content

Instantly share code, notes, and snippets.

@rbsgn
Created November 7, 2015 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rbsgn/2f67da093f1a2d141799 to your computer and use it in GitHub Desktop.
Save rbsgn/2f67da093f1a2d141799 to your computer and use it in GitHub Desktop.
JSON in Swift
enum JSON {
indirect case Object([Swift.String: JSON])
indirect case Array([JSON])
case String(Swift.String)
case Number(Int)
case Boolean(Bool)
case Null
}
let json = JSON.Object(["foo": JSON.String("bar")])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment