Update for 0.1.5
Written in swift.
Using SPM (in your Package.swift):
let package = Package( name: "NameOfYourProject", dependencies: [ .package(url: "https://github.com/asoderman/JSONDecoder.git", from: "0.1.5") ] )
then
swift package resolve
Quickstart
let j = try! JSONParser(text: JSONTEXT).flatten() let name = j["name"] as! String let id = j["id"] as! Int
Error handling
do { let j = try JSONParser(text: BADJSON).flatten() let name = j["name"] as! String let id = j["id"] as! Int } catch { // Do something } }
swift package generate-xcodeproj
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
Simple JSON Parser
Written in swift.
Installation:
Using SPM (in your Package.swift):
then
Usage:
Quickstart
Error handling
To work on this library:
swift package generate-xcodeproj