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怎樣寫?
d1.getData = {(Int32 item)in
//do sth
}