iOS Slider touchesEnded参数

时间:2011-10-24 10:54:50

标签: ios cocoa-touch

我有一个滑块元素,我想检测一个touchesEnded动作。

我正在尝试以编程方式添加touchesEnded操作:

[self.slider touchesEnded:(NSSet *] touches withEvent:event];

问题是我不知道从哪里获取touches变量(我假设事件参数是我希望在触摸结束后调用的函数)。

1 个答案:

答案 0 :(得分:1)

为UISlider创建一个子类。实施

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event

子类中的方法。将触摸事件委托给您查看。