I am animating a textfield with the following code:
UIView.animateWithDuration(0.5, delay: 0.4,
options: .Repeat | .Autoreverse | .CurveEaseOut, animations: {
self.password.center.x += self.view.bounds.width
}, completion: nil)
I get the error Could not find member 'Repeat'
The code only works if I set only one option. Why is it not letting me set multiple options?
The syntax for combining OptionSetType
has changed, you will be able to do it like this:
UIView.animateWithDuration(0.5, delay: 0.4,
options: [.Repeat, .CurveEaseOut, .Autoreverse], animations: {
self.password.center.x += self.view.bounds.width
}, completion: nil)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With