UIButton not interacting during animation

There were some questions here recently about this. The animation is purely visual. You can tap the button in it'd old frame until the animation is complete, when it finishes, the actual button jumps.

EDIT:

This answer is what I was referring to. You need to manually move the button with an NSTimer, apparently. See the linked question/answer for more.

Other folks suggest passing UIViewAnimationOptionAllowUserInteraction as a UIViewAnimation option.


Try setting the animation option to UIViewAnimationOptionAllowUserInteraction.

[UIView animateWithDuration:.2
                      delay: 0
                    options: UIViewAnimationOptionAllowUserInteraction
                 animations:^{ 
                     // animation logic
                 }
                 completion:^(BOOL completed) { 
                     // completion logic
                 }
 ];

For swift 4 this code works,

UIView.animate(withDuration: 2, delay: 0, options: [.autoreverse, .repeat, .allowUserInteraction],
                   animations: {
                    self.btnCashGame?.frame.origin.y -= 15



    },completion:  { (finished: Bool) in
        self.btnCashGame?.frame.origin.y += 15

    })