目录
目录README.md

Simple JSON Parser

Written in swift. Build Status

Installation:

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

Usage:

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
        }
    }

To work on this library:

  1. Fork this repo on github.
  2. Create a local copy of your repo.
  3. swift package generate-xcodeproj
  4. Submit pull requests.
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号