问题
I added this code to my graphViewController:
-(BOOL)pointingDeviceDownEvent:(id)event atPoint:(CGPoint)interactionPoint {
NSLog(@"Touched.");
}
but it is not firing on touch. What am I doing wrong?
回答1:
i'm using the CPPlotSpaceDelegate protocol to receive touches on ios.
after setting the delegate for your defaultPlotSpace you'll get called on the following methods when touches are received
-(BOOL)plotSpace:(CPPlotSpace *)space shouldHandlePointingDeviceUpEvent:(id)event atPoint:(CGPoint)point;
-(BOOL)plotSpace:(CPPlotSpace *)space shouldHandlePointingDeviceCancelledEvent:(id)event;
-(BOOL)plotSpace:(CPPlotSpace *)space shouldHandlePointingDeviceDownEvent:(id)event atPoint:(CGPoint)point;
-(BOOL)plotSpace:(CPPlotSpace *)space shouldHandlePointingDeviceDraggedEvent:(id)event atPoint:(CGPoint)point;
来源:https://stackoverflow.com/questions/5694964/how-do-observe-touch-events-in-core-plot-on-ios