如何快速处理多个选项时,动画UIView?我试过了
UIView.animateWithDuration(0.2, delay: 0.0, options: .Repeat | .Autoreverse, animations: {self.alpha = 0.0}, completion: nil)但似乎将|与按位运算符混淆在一起:
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)我正在使用来自AppStore的最新Xcode版本。
发布于 2015-06-16 19:19:22
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)发布于 2016-02-16 13:48:27
预览答案不会在现在的快速工作。@mxcl给出了好的答案。
如果尽管您想使用此表单,但必须检索rawValue并使用包含或掩码重建一个新的UIViewAnimationOptions。
UIViewAnimationOptions(rawValue:(UIViewAnimationOptions.Autoreverse.rawvalue | UIViewAnimationOptions.Repeat.rawValue))发布于 2016-10-28 02:41:45
Swift 3:测试并确定:
UIView.animate(withDuration: 0.2, delay: 0.0, options: [.repeat, .autoreverse], animations: {
}, completion: nil)https://stackoverflow.com/questions/26230884
复制相似问题