Hristo Hristo - 3 years ago 132
Swift Question

Swift animate UIView with multiple options

How does swift handle multiple options when animating UIView? I tried

UIView.animateWithDuration(0.2, delay: 0.0, options: .Repeat | .Autoreverse, animations: {self.alpha = 0.0}, completion: nil)


but seems to confuse the
|
with a bitwise operator:

Undefined symbols for architecture i386:
"__TFSsoi1oUSs17_RawOptionSetType_USs21BitwiseOperationsTypeSs9Equatable__FTQ_Q__Q_", referenced from:
__TFC17TextDrawing10cursorViewW8blinkingSb in cursorView.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)


I am using the latest Xcode version from the AppStore.

Answer Source

With Swift 2, it is now:

UIView.animateWithDuration(0.2, delay: 0.0, options: [.Repeat, .Autoreverse], animations: {self.alpha = 0.0}, completion: nil)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download