如何在iOS的核心图中观察触摸事件? [英] How do observe touch events in core plot on ios?

查看:54
本文介绍了如何在iOS的核心图中观察触摸事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将此代码添加到了我的graphViewController中:

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?

推荐答案

我正在使用CPPlotSpaceDelegate协议来接收ios上的触摸。

i'm using the CPPlotSpaceDelegate protocol to receive touches on ios.

在为您的defaultPlotSpace设置了委托之后,您将在收到触摸时通过以下方法调用

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;

这篇关于如何在iOS的核心图中观察触摸事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆