iOS 异步开发 PromiseKit
- 授权协议: MIT
- 开发语言: Swift Objective-C Ruby
- 操作系统: OS X
- 软件首页: http://promisekit.org/
- 软件文档: https://github.com/mxcl/promisekit
软件介绍
现代化的开发都要求高度异步,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){
//…});
算法笔记上机训练实战指南
胡凡、曾磊 / 机械工业出版社 / 2016-7 / 57
《算法笔记上机训练实战指南》是《算法笔记》的配套习题集,内容按照《算法笔记》的章节顺序进行编排,其中整理归类了PAT甲级、乙级共150多道题的详细题解,大部分题解均编有题意、样例解释、思路、注意点、参考代码,且代码中包含了详细的注释。读者可以通过本书对《算法笔记》的知识点进行更深入的学习和理解。书中印有大量二维码,用以实时更新或补充书籍的内容及发布本书的勘误。 《算法笔记上机训练实战指南》可......一起来看看 《算法笔记上机训练实战指南》 这本书的介绍吧!
