PDA

View Full Version : fades and other transitions




Shadylane315
Sep 9, 2009, 07:42 PM
Here is my code:

CATransition *animation = [CATransition animation];
[animation setDuration:0.5];
[animation setType:kCATransitionFade];
[animation setSubtype:kCATransitionFromLeft];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];

[[theWindow layer] addAnimation:animation forKey:@"SwitchToView1"]

When i run and build the project it does not insert the fades in between my pictures. Am i missing something here. I think i need to call this animation but where and how?



PhoneyDeveloper
Sep 10, 2009, 11:57 AM
Look at the ViewTransitions sample app.

You need to do something inside the animation block that will fade. You create the animation block but you don't add a new view or anything that should fade.