Swift animate UIView with multiple options
Swift 3: Tested and ok:
UIView.animate(withDuration: 0.2, delay: 0.0, options: [.repeat, .autoreverse], animations: {
}, completion: nil)
The preview answer won't work in nowdays swift. The good answer was given by @mxcl.
If despite all you want to use this form, you have to retrieve the rawValue and rebuild a new UIViewAnimationOptions with an inclusive OR mask.
UIViewAnimationOptions(rawValue:(UIViewAnimationOptions.Autoreverse.rawvalue | UIViewAnimationOptions.Repeat.rawValue))
Swift 2:
UIView.animateWithDuration(0.2, delay: 0.0, options: [.Repeat, .Autoreverse], animations: {self.alpha = 0.0}, completion: nil)
Swift 3, 4, 5
UIView.animate(withDuration: 0.2, delay: 0.0, options: [.repeat, .autoreverse], animations: {self.alpha = 0.0}, completion: nil)