views:

74

answers:

1

I have a CATransition (code below) that moves a view down. How can I specify a location for the animation to start, for example 60, 30.

Here's the code I'm currently using:

CATransition *animation = [CATransition animation];
[animation setDuration:0.5];
[animation setType:kCATransitionPush];
[animation setSubtype:kCATransitionFromBottom];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
A: 

Write your own timing function that does what you want?

EDIT: I was originally suggesting that you subclass CAMediaTimingFunction, but it looks like that might not do the right thing. Instead, try experimenting with setting CATransition.startProgress, though it's a value in [0,1], not a number of pixels (if you're using a linear animation then it should be easy to convert).

I'm still not entirely sure what you mean by "a location for the animation to start", though — transitions apply to the entire view bounds. Normal UIView animations may be more likely to do what you want. If you give more details, it's easier to figure out what the problem you're trying to solve is.

tc.
how?? Sorry, still a noob at Quartz stuff
Matt S.