【发布时间】:2013-10-05 06:49:47
【问题描述】:
在为 UIButton 定义回调时,我为同一个操作列出了多个事件
在目标中我希望能够区分是什么事件触发了回调
[button addTarget:self action:@selector(callback:) forControlEvents:UIControlEventTouchDown | UIControlEventTouchCancel];
-(void)callback:(UIButton *)button
{
// need to be able to distinguish between the events
if (event == canceled)
{
}
if (event == touchDown)
{
}
... etc
}
【问题讨论】:
标签: ios objective-c uibutton uicontrol uicontrolevents