CAAnimationGroup with different interface elements
Asked Answered
Q

1

7

I want to crossfade two NSViews and resize their NSWindow. I know how to do them separately but so far not how to do it simultaneously. I think I need a CAAnimationGroup for it. But because I'm dealing with two different objects, I don't know how to add the two animations in the group and I don't know how to start the animation because I can't call animator on them both.

Quarto answered 27/8, 2010 at 12:34 Comment(0)
G
1

you should use a CATransaction to do this. all animations are grouped with CATransactions, either implicitly or explicitly, check the docs for more details. Just use something like:

[CATransaction begin];
[CATransaction setAnimationDuration:1.0];
[CATransaction setAnimationTimingFunction:whatever];

 // adjust layer properties here for required animations

[CATransaction commit];
Gutenberg answered 13/3, 2012 at 8:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.