Silver solution


#1

Hello, I have this silver solution:

[code]
-(void) makeButtonSlide
{
// Create a basic animation
CABasicAnimation *mover = [CABasicAnimation animationWithKeyPath:@“position”];

[mover setDelegate:self];
[mover setFromValue:[NSValue valueWithCGPoint:CGPointMake(0.0, timeButton.center.y)]];
[mover setToValue:[NSValue valueWithCGPoint:CGPointMake(100,timeButton.center.y)]];

[mover setDuration:0.5];

// Set the timing function
CAMediaTimingFunction *tf =  [CAMediaTimingFunction
                              functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
[mover setTimingFunction:tf];

[[timeButton layer] addAnimation:mover
                         forKey:@"spinAnimation"];

}[/code]

which is similar to one posted on this site. However, the animation is a bit strange still.
The button slowly starts moving from the left edge of the screen towards center,
and then after some time, it jumps to the destination point.
In other words, the animation is not smooth.

Why is this the case??? Thank you.

ps. As I said if I correct coordinates in it, as in one of the solutions posted here,
animation is smooth.

EDIT: I found reason why it happens. The thing is when the animation finishes
the button is directly moved to its original position as it was set in the XIB file.
– why is this the case? should it be like this? thanks.