PromiseKit Swift/ObjC异步

嗯,PromiseKit 其实挺简单,适合用在 Swift 和 ObjC 中来异步编程。如果你觉得传统的回调地狱烦,PromiseKit 可以帮你简化流程。用起来方便,是在做网络求或其他异步操作时,代码看起来也会更加简洁清晰。

例如,你只需要写个URLSession.shared.dataTask(.promise, with: url),后面链式调用就行了,连图像的都可以一起搞定,效果蛮不错的。

而且 PromiseKit 的学习曲线也不陡峭,简单掌握后,写代码的感觉会更加流畅。大部分时候,PromiseKit的代码比传统的回调要简洁、易读,后期维护也相对轻松。你的同事们会感谢你省去了多复杂的回调链。

如果你在做网络求,PromiseKit还可以跟URLSession结合使用,甚至在一些老项目中,也能快速引入,保持代码的整洁。

如果你不想在回调和异步代码中陷得太深,试试PromiseKit,确实能让你的代码更优雅,提升开发效率。

folder
PromiseKit:Swift和ObjC的承诺 预估大小:125个文件
file
.gitmodules 3KB
file
LICENSE 1KB
file
fwd.h 6KB
file
AnyPromise.m 4KB
file
AnyPromise+Private.h 1021B
file
AnyPromise.h 11KB
file
when.m 4KB
file
PMKCallVariadicBlock.m 4KB
file
NSMethodSignatureForBlock.m 3KB
file
PromiseKit.h 217B
file
.gitignore 144B
file
index.js 1KB
file
package.json 385B
file
package-lock.json 277KB
file
.gitignore 985B
file
webpack.config.js 522B
file
JoinTests.m 3KB
file
WhenTests.m 7KB
file
AnyPromiseTests.m 25KB
file
Infrastructure.h 383B
zip 文件大小:212.16KB