CALayer Transitions
CALayer Transitions
- Subject: CALayer Transitions
- From: Gordon Apple <email@hidden>
- Date: Sat, 14 Nov 2009 14:58:31 -0600
- Thread-topic: CALayer Transitions
I assume this should be simple, but so far I haven't found the magic
incantation, even after reading the docs, Dudley's book, and some archives.
Problem: Layer called "contentLayer" has sublayers containing layer A,
which is to be transitioned to layer B. (Note: Using GC here.) Controller
code:
-(void)transitionFrom:(CALayer*)A to:(CALayer*)B{
CATransition* trans = [CATransition animation];
trans.type = kCATransitionPush;
trans.subtype = kCATransitionFromLeft;
trans.speed = 0.5;
[[self contentLayer] addAnimation:trans forKey:kCATransition];
[[self contentLayer] replaceSublayer:A with:B];
}
My understanding (likely wrong) is that replaceSublayer triggers the
necessary action to start the transition, then the animation object is
automatically removed (default).
I get an initial transition, then on subsequent calls get layer
replacement but no transition. What am I missing?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden