How do observe touch events in core plot on ios?

自古美人都是妖i 提交于 2020-01-05 08:44:01

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!