Swift 3
和以前几乎一样:
UIView.animate(withDuration: 0.2, delay: 0.2, options: UIViewAnimationOptions.repeat, animations: {}, completion: nil)
除了你可以省略完整类型:
UIView.animate(withDuration: 0.2, delay: 0.2, options: .repeat, animations: {}, completion: nil)
你仍然可以组合选项:
UIView.animate(withDuration: 0.2, delay: 0.2, options: [.repeat, .curveEaseInOut], animations: {}, completion: nil)
Swift 2
UIView.animateWithDuration(0.2, delay: 0.2, options: UIViewAnimationOptions.Repeat, animations: {}, completion: nil)
UIView.animateWithDuration(0.2, delay: 0.2, options: .Repeat, animations: {}, completion: nil)
UIView.animateWithDuration(0.2, delay: 0.2, options: [.Repeat, .CurveEaseInOut], animations: {}, completion: nil)