TestsTested | ✓ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Apr 2016 |
SPMSupports SPM | ✗ |
Maintained by ShengHuaWu.
This is a JSON parser in Swift. There have been many JSON parser projects in GitHub, such as SwiftyJSON and JASON.
First thing is to import the JSONParser framework. Once imported, you’re able to create a JSON with NSData, and get the value via subscript.
let data: NSData = ...
let json = try! JSON(data: data)
let email = json["email"].string // Return an optional string.
let name = json["name"].stringValue // Return a name string or an empty string.