我在 UIView 的 touchesBegan 方法中有一些操作和动画,我将其子类化并作为类附加到我的视图中。我需要动画之间的一些延迟。
代码:
- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
// Add delay to imitate the hold for touch 1 second and if true continue
// else cancel everything
[self animateViewSize]; // Here animates the view frame
// Add delay until sizing animation ends.....
[self animateViewFlip]; // Here animates the view flip y axis
[[NSNotificationCenter defaultCenter] postNotificationName:@"A Notification" object:self];
// Notify the superview Controller that touch happened and do some operations with animations too...
// Some variables appending values for the UIView location when it touched
}
- (void) animateCardSize
{
// Animate using UIView animation
}
- (void) animateFlipView
{
// Animate flip using CABasicAnimation
}
这是基本思想......
谢谢你。