ブロックベースのアニメーションのオプションフィールドを使用して、アニメーション中にユーザーがビューを操作できるようにするのは非常に簡単です。しかし、私のプログラムでは CAKeyframeAnimation を使用していますが、ユーザー操作を有効にするためのプロパティが表示されません。これを行う方法はありますか?
ありがとう、
編集:実際のコードは次のとおりです。
- (void)move
{
CGMutablePathRef path = CGPathCreateMutable();
CGPathMoveToPoint(path, NULL, 50, 120);
for (int i = 0; i < 5; i ++)
CGPathAddLineToPoint(path, NULL, arc4random() % 320, arc4random() % 480);
CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"position"];
[animation setPath:path];
[animation setDuration:10];
CFRelease(path);
[self.layer addAnimation:animation forKey:@"move"];
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
[self setAlpha:0];
}