Reputation: 5039
i am trying to animate the rotation of an imageview. it is rotating and animating but my animation start slowly and it speed up with time lets say i am performing animation with 5 seconds duration then first 1-2 seconds my image is rotating slowly but as time gets closer to 5 it speeds up here is my code
UIView.animateWithDuration(5.0, delay:0 , options: .Repeat , animations: {
//fan is UIImageView
self.fan.transform = CGAffineTransformMakeRotation((180.0 * CGFloat(M_PI)) / 180.0)
}, completion: nil)
Upvotes: 1
Views: 2421
Reputation: 385500
The default animation curve is .CurveEaseInOut
. You want .CurveLinear
.
UIView.animateWithDuration(5.0, delay:0, options: [.Repeat, .CurveLinear] , animations: {
//fan is UIImageView
self.fan.transform = CGAffineTransformMakeRotation((180.0 * CGFloat(M_PI)) / 180.0)
}, completion: nil)
Upvotes: 2