UIView animation options using Swift

Swift 3

Pretty much the same as before:

UIView.animate(withDuration: 0.2, delay: 0.2, options: UIViewAnimationOptions.repeat, animations: {}, completion: nil)

except that you can leave out the full type:

UIView.animate(withDuration: 0.2, delay: 0.2, options: .repeat, animations: {}, completion: nil)

and you can still combine options:

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)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)