0
我在UIView的touchesBegan方法內部有一些操作和動畫,這些操作和動畫在我的視圖中被分類並追加爲類。 我需要動畫之間的一些延遲。在UIView動畫之間添加延遲
代碼:
- (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
}
這是基本的想法.....
謝謝。
感謝名單發表評論使用我有大小,所以我增加了一個基於塊的動畫完成代碼中的第二個翻轉動畫,解決了一個問題。在動畫開始之前和通知之前,我需要的觸摸延遲如何? – 2012-07-13 13:30:12