That's because ios places your animating view to the target position, when the animation starts, but draws it on the path. So if you tap the view while moving, you actually tap somewhere out of its frame.
In your animating view's init, set userInteractionEnabled to NO. So the touch events are handled by the superview.
self.userInteractionEnabled = NO;
In your superview's touchesBegan method, check your animating view's presentationLayer position. If they match with the touch position, redirect the touchesBegan message to that view.
- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
CGPoint point = [[touches anyObject] locationInView:self.view];
CGPoint presentationPosition = [[animatingView.layer presentationLayer] position];
if (point.x > presentationPosition.x - 10 && point.x < presentationPosition.x + 10
&& point.y > presentationPosition.y - 10 && point.y < presentationPosition.y + 10) {
[animatingView touchesBegan:touches withEvent:event];
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…