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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to