DecodeContext 0.2.1

DecodeContext 0.2.1

测试已测试
Lang语言 SwiftSwift
许可证 MIT
发布最后发布2016年8月
SPM支持 SPM

muukiimuukii 维护。



DecodeContext

示例

定义上下文

extension String {
    static let decodeContext = DecodeContext<SwiftyJSON.JSON, String> { json in
        return json.string
    }
}

解码

let id = try Decoder(String.decodeContext, json["id"]).get()

需求

安装

DecodeContext 可通过 CocoaPods 获得。要安装它,只需将以下行添加到您的 Podfile 即可

pod "DecodeContext"

作者

muukii,[email protected]

许可证

DecodeContext 在 MIT 许可证下提供。有关更多信息,请参阅 LICENSE 文件。