paul-tian / SmallJSONParser

A lightweight and small JSON parser for Swift.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SmallJSONParser

Carthage compatible

A lightweight and small JSON parser for Swift.

Based on "Dynamic Member Lookup" Types.Learn more here Introduce User-defined "Dynamic Member Lookup" Types.

let string = "{\"id\": 923, \"name\": \"hello\", \"coord\":{\"lon\": 116.4, \"lat\": 39.91}}"
let json = JSON.parse(string)
let id = json.id.intValue    //   923
let name: String = json.name    //   hello
let lon: Double = json.coord.lon    //  116.4

Requirements

  • Swift 4.2 or later

Installation

  • Insert github "chn-lyzhi/SmallJSONParser" to your Cartfile.
  • Run carthage update.
  • Link your app with SmallJSONParser.framework in Carthage/Build.

(coming soon)

  • Insert pod 'SmallJSONParser' to your Podfile.
  • Run pod install.

About

A lightweight and small JSON parser for Swift.

License:MIT License


Languages

Language:Swift 94.8%Language:Ruby 2.9%Language:Objective-C 2.3%