When I want to animate the UIImageView
, the UITapGestureRecognizer
added to it can not work. WHY???
-(void) testTap:(id)sender {
NS
You need to allow user interaction during animation.
UIViewAnimationOptions options = UIViewAnimationCurveEaseInOut | UIViewAnimationOptionAllowUserInteraction;
Just to add to this for Swift...something like this will work very well... Use .AllowUserInteraction.
UIView.animateWithDuration(0.4, delay: 1.5, usingSpringWithDamping: 0.5, initialSpringVelocity: 20, options: UIViewAnimationOptions.AllowUserInteraction, animations:
{self.frame = originalFrame}, completion: nil)