It is very easy to allow users to interact with views while animating using the options field of block based animation. But in my program I am using a CAKeyframeAnimation and I don't see any properties to set user interaction enabled. Is there any way to do this?
Thanks,
EDIT: Here is the actual code:
- (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]; }