JSON (RFC 7159) for Swift 2.2.
import JSON
// parse JSON string
let json = try! JSONParser.parse("{\"foo\":\"bar\"}")
// create JSON literal
let json: JSON = [
"null": nil,
"string": "Foo Bar",
"boolean": true,
"array": [
"1",
2,
nil,
true,
["1", 2, nil, false],
["a": "b"]
],
"object": [
"a": "1",
"b": 2,
"c": nil,
"d": false,
"e": ["1", 2, nil, false],
"f": ["a": "b"]
],
"number": 1969
]
- Add
JSON
to yourPackage.swift
import PackageDescription
let package = Package(
dependencies: [
.Package(url: "https://github.com/Zewo/JSON.git", majorVersion: 0, minor: 1)
]
)
Join us on Slack.
JSON is released under the MIT license. See LICENSE for details.