在标准库源码基础上做了改动,以解决 JSONDecoder 各种解析失败的问题,如键值不存在,值为 null,类型不一致。
To run the example project, clone the repo, and run pod install
from the Example directory first.
- iOS 9.0+
- Swift 4
CleanJSON is available through CocoaPods or Carthage. To install it, simply add the following line to your Podfile or Cartfile:
pod 'CleanJSON'
githut "Pircate/CleanJSON"
import CleanJSON
let decoder = CleanJSONDecoder()
try decoder.decode(Model.self, from: data)
Pircate, [email protected]
CleanJSON is available under the MIT license. See the LICENSE file for more info.