测试已测试 | ✓ |
语言语言 | SwiftSwift |
许可证 | MIT |
发布最后发布 | 2015年1月 |
SPM支持 SPM | ✗ |
由 Witold Skibniewski 维护。
处理通过引用接收错误的 iOS SDK API 的包装器。
一些好处
NSErrorPoint
的方法的操作。NSError
变量来按引用传递(请使用包装器传递到的闭包中的 $0
简短参数名称)。AnyObject?
实例)。tryWithErrorPointer { NSJSONSerialization.JSONObjectWithData(data, options: nil, error: $0) }
.onError { error in /* handle error */ }
.onSuccess { result in /* handle success */ } }
带有类型转换
tryWithErrorPointer(castResultTo: NSDictionary.self) { NSJSONSerialization.JSONObjectWithData(data, options: nil, error: $0) }
.onError { error in /* handle error */ }
.onSuccess { result in /* handle success */ } }
要了解更多细节,请查看 测试 和那些资源