如何在UIView动画块中将UIViewAnimationOptions设置为.Repeat:
UIView.animateWithDuration(0.2,delay:0.2,options: UIViewAnimationOptions,animations: (() -> Void),completion: (Bool) -> Void)?)
Swift 3
原文链接:https://www.f2er.com/swift/320955.html几乎和以前一样:
UIView.animate(withDuration: 0.2,delay: 0.2,options: UIViewAnimationOptions.repeat,animations: {},completion: nil)
除了你可以省掉完整的类型:
UIView.animate(withDuration: 0.2,options: .repeat,completion: nil)
您仍然可以合并选项:
UIView.animate(withDuration: 0.2,options: [.repeat,.curveEaseInOut],completion: nil)
Swift 2
UIView.animateWithDuration(0.2,options: UIViewAnimationOptions.Repeat,completion: nil) UIView.animateWithDuration(0.2,options: .Repeat,options: [.Repeat,.CurveEaseInOut],completion: nil)