I'm making a simple app that involves a button moving across the screen and I would like for the user to be able to click it while it moves. I have this:
func bonus ()
{
UIView.animateWithDuration(14,
delay: 0.1,
options: UIViewAnimationOptionsAllowUserInteraction,
animations: {
self.bonusbutton.center = CGPointMake(self.bonusbutton.center.x + 1000, self.bonusbutton.center.y)
}, completion : nil)
}
Which gives me the "use of unresolved identifier UIViewAnimationOptionAllowUserInteraction"
error.
I tried options: UIViewAnimationOptions.AllowUserInteraction
which compiles, but doesn't allow the button to be clickable during animations.
I visited developer portal but I'm fairly new to Swift. What am I doing wrong? Thanks!