在为我的 defaultPlotSpace 设置委托后,我使用 CPPlotSpaceDelegate 协议在 iOS 和以下方法上接收触摸:
- (BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceDownEvent:(id)event
atPoint:(CGPoint)point{
}
-(BOOL)plotSpace:(CPPlotSpace *)space shouldHandlePointingDeviceDraggedEvent:(id)event atPoint:(CGPoint)point{
NSSet *allTouches = [event allTouches];
UITouch *touch1 = [[allTouches allObjects] objectAtIndex:0];
UITouch *touch2 = [[allTouches allObjects] objectAtIndex:1];
/*
CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)space;
CPTScatterPlot *scatterPlot = [[[plotSpace graph] allPlots] objectAtIndex:0];
CGPoint plotAreaPoint = [[plotSpace graph] convertPoint:point toLayer:scatterPlot];
NSLog(@"PlotAreaPoint : %.1f, %.1f", plotAreaPoint.x, plotAreaPoint.y);
*/
}
-(BOOL)plotSpace:(CPPlotSpace *)space shouldHandlePointingDeviceUpEvent:(id)event atPoint:(CGPoint)point{
}
如何通过多次触摸获得“PlotAreaPoint”?有人请帮帮我吗?