I have a translate animation, moving my button from A to B.
That route looks like this:
1) Button slowly accelerates 2) At the middle of animation gets to the peak of it's speed 3) Slows down as it approaches the end
This is my code
[UIView animateWithDuration:speed
delay:delay
options:UIViewAnimationOptionAllowUserInteraction
animations:^(void){
[UIView setAnimationRepeatCount:5];
cloud.frame = (CGRectMake(cloud.frame.origin.x,
cloud.frame.origin.y+900, cloud.frame.size.width, cloud.frame.size.height));
}completion:nil];
I want my animation to have a same speed all the time.
How can I achieve this?
Add the
UIViewAnimationOptionCurveLinear
to your animation options, like this: