views:

355

answers:

2

Hi,

I want to use a timing function lets say kCAMediaTimingFunctionEaseInEaseOut

My aim is I have start point (X1,Y1) and end point (X2,Y2) and I want a ease function which will provide the easing functionality over this points range. Like varying the (X,Y) range and giving me a curve from start to end.

How to do that in iPhone. Like in the following article

http://www.the-art-of-web.com/css/timing-function/

we can see the blocks moving, I want something like that.

+1  A: 

This post is a good starting point for you:

http://icodeblog.com/2009/07/23/nstimer-the-poor-mans-threading-code-snapshot/

Michael Alves
Well this is being done by user. I am talking about how to use the inbuilt library for that. Inbuilt library something similar to timing functions.
rkb
A: 

When animating the movement of a UIView within a begin / commit animation block, you can use the following method to set the animation timing curve:

[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];

When animating a layer via CAAnimation, you can use the following to set the timing function there:

[animation setTimingFunction:kCAMediaTimingFunctionEaseInEaseOut];

Finally, when wrapping a series of animations in a CATransaction, you can use the following to set the coordinated timing function of all the animations:

[CATransaction setAnimationTimingFunction:kCAMediaTimingFunctionEaseInEaseOut];
Brad Larson
[CATransaction setAnimationTimingFunction:kCAMediaTimingFunctionEaseInEaseOut] does not work anymore, one has to use the following instead:[CATransaction setAnimationTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
valexa