i use UIPanGestureRecognizer to move an object along the path drawn by the user. But this object is animating and i need to interact with it during animation. Is it possible? I already try to use UIViewAnimationOptionAllowUserInteraction
but no results.
Asked
Active
Viewed 1,198 times
0

j0k
- 22,600
- 28
- 79
- 90

Andrea Mario Lufino
- 7,921
- 12
- 47
- 78
-
http://stackoverflow.com/a/5572717/1059705 & http://stackoverflow.com/q/8340329/1059705 this may help you – Bala Nov 05 '12 at 14:59
-
http://developer.apple.com/library/ios/documentation/UIKit/Reference/UIView_Class/UIView/UIView.html#//apple_ref/doc/c_ref/UIViewAnimationOptionAllowUserInteraction – Bala Nov 05 '12 at 15:05
1 Answers
0
Yes it is possible. But I would use CABasicAnimation
for animating the object and not the UIView animationWith...
and then add the UIPanGestureRecognizer
to the object. So some example code:
// Configure the animation and add it to the layer.
CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@"position"];
anim.fromValue = ...
anim.duration = ...
[view.layer addAnimation:anim forKey:@"some key"];
// Then add the UIPanGestureRecognizer to that view.

Masa
- 3,241
- 1
- 16
- 12
-
And how can i do this? So, now i'm using UIView animation and I move the object frame, but with CABasicAnimation how can i do the same thing? – Andrea Mario Lufino Nov 05 '12 at 14:56
-
So the object is moving and when the user taps it, it should stop moving and follow his pan gesture? Is that what you want? – Masa Nov 05 '12 at 15:01
-