iOS延迟touchUpInside按钮事件

时间:2014-07-22 14:01:04

标签: ios objective-c cocoa-touch animation

我的UIButton子类中有一些自定义动画。我重写了一些内部方法来开始和结束动画

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    [super touchesBegan:touches withEvent:event];
    //there is my start animation
}

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
    [super touchesEnded:touches withEvent:event];
    //there is my end animation
}

- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
    [super touchesCancelled:touches withEvent:event];
    //there is my end animation
}

几乎所有的好事。我的所有按钮都会对事件UIControlEventTouchUpInside执行一些操作。而且有我的问题。仅在我的应用处理touchesEnded事件后才会调用touchesCancelledUIControlEventTouchUpInside方法。所以按钮中的动画看起来不像我想要的那么好。

所以问题是:我可以在某些ms上延迟UIControlEventTouchUpInside事件并首先处理我的按钮的touchesEnded方法以获得平滑动画吗?

0 个答案:

没有答案
相关问题