Im creating a UIView animation:
UIView.animateWithDuration(0.1,
delay: 0,
options: (.AllowUserInteraction | .Repeat | .Autoreverse),
animations:
{ () -> Void in
// Animate
},
completion: nil)
But the compiler says “Could not find member “Autoreverse””, or whichever bit mask is on the end, unless there is one option. Has the syntax changed in Swift 2? I can’t see anything in the Swift docs nor do I remember anything in the WWDC presentations.
Or could it possibly just be a bug?
Thanks in advance
Answer found here:
Swift 2.0 - Binary Operator "|" cannot be applied to two UIUserNotificationType operands
“In Swift 2 the syntax has been updated..”
To cut it short, instead of
.Type | .Another | .Third
Use
[.Type, .Another, .Third]
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