Created
November 7, 2015 20:21
-
-
Save rbsgn/2f67da093f1a2d141799 to your computer and use it in GitHub Desktop.
JSON in Swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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