cxdxiaodou 2015-01-14 08:17 采纳率: 0%
浏览 1859
已采纳

这个obj-c代码在swift要怎么写?

 d1.getData = ^(NSUInteger item) {
    float x = [vals[item] floatValue];
    float y = [vals2[item] floatValue];
    NSString *label1 = [NSString stringWithFormat:@"%d", item];
    NSString *label2 = [NSString stringWithFormat:@"%f", y];
    return [LineChartDataItem dataItemWithX:x y:y xLabel:label1 dataLabel:label2];
};


这一行 d1.getData = ^(NSUInteger item) 不知在swift怎样写?

  • 写回答

1条回答 默认 最新

  • spmsv 2015-01-18 09:14
    关注

    d1.getData = {(Int32 item)in
    //do sth
    }

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?