iOS 异步开发 PromiseKit

码农软件 · 软件分类 · iOS/iPhone/iPad开发包 · 2019-05-16 10:27:50

软件介绍

现代化的开发都要求高度异步,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){
    //…});


本文地址:https://codercto.com/soft/d/5854.html

ggplot2:数据分析与图形艺术

ggplot2:数据分析与图形艺术

哈德利·威克姆 (Hadley Wickham) / 统计之都 / 西安交通大学出版社 / 2013-5-1 / CNY 46.00

中译本序 每当我们看到一个新的软件,第一反应会是:为什么又要发明一个新软件?ggplot2是R世界里相对还比较年轻的一个包,在它之前,官方R已经有自己的基础图形系统(graphics包)和网格图形系统(grid包),并且Deepayan Sarkar也开发了lattice包,看起来R的世界对图形的支持已经足够强大了。那么我们不禁要问,为什么还要发明一套新的系统? 设计理念 打个比......一起来看看 《ggplot2:数据分析与图形艺术》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具