PromiseKitiOS 异步开发
现代化的开发都要求高度异步,iOS 开发也是一样,PromiseKit 能提供强大的 iOS 开发异步功能,非常容易使用。
PromiseKit 不仅仅是 Promises 的实现,还是辅助函数的集合,使得 iOS 开发典型的异步模式更强大。
PromiseKit 支持集成到其他 Cocoapods,如果用户的库有异步操作,而又喜欢使用 PromiseKit,则可以添加了一个可选的缺省子说明书,提供 Promises 服务,文档会帮助集成 PromiseKit 到用户自身的 pods 中。
示例:
[CLLocationManager promise].catch(^{ return self.chicagoLocation;}).then(^(CLLocation *loc){ return [NSURLConnection GET:@"http://user.net/%f/%f", loc.latitude, loc.longitude];}).then(^(NSDictionary *user){ UIAlertView *alert = [UIAlertView new]; alert.title = [NSString stringWithFormat:@"Hi, %@!", user.name]; [alert addButtonWithTitle:@"Bye"]; [alert addButtonWithTitle:@"Hi!"]; return alert.promise;}).then(^(NSNumber *tappedButtonIndex, UIAlertView *alert){ if (tappedButtonIndex.intValue == alert.cancelButtonIndex) return nil; id vc = [HelloViewController new] return [self promiseViewController:vc animated:YES completion:nil].then(^(id resultFromViewController){ //… });}).catch(^(NSError *err){ //…});
评论
Wind.js异步JS开发库
Wind.js的前身是Jscex,Jscex是“JavaScriptComputationEXpression”的缩写,它为JavaScript语言提供了一个monadic扩展。Jscex完全使用Ja
Wind.js异步JS开发库
0
Jscex异步JS开发库
Jscex已改名为Wind.jsJscex是“JavaScriptComputationEXpression”的缩写,它为JavaScript语言提供了一个monadic扩展。Jscex完全使用Jav
Jscex异步JS开发库
0
ez_pollC++异步网络开发库
这是C++实现的一个异步网络开发库,只能够在linux系统下工作.开发的初衷是维护一个自实现的,满足工作需求,符合工程实践的网络开发库,可以快速安全的开发业务代码.
ez_pollC++异步网络开发库
0