Question

I'm working on a Snow Leopard app and I'm doing some view animations (swapping them) and I've seen some older examples using NSViewAnimation. I'm wondering if these are completely obsoleted by Core Animation?

It seems fairly simple for me to use

[[myView animator] setFrame:newSwapFrame];

But I'm just wondering if I'm missing something, or if NSViewAnimation is still relevant (other than for backwards compatibility).

Was it helpful?

Solution

Generally you should move to Core Animation for 10.5+ code. NSViewAnimation is fairly primitive and doesn't make as efficient use of the hardware. I can't think of any advantages of staying with NSViewAnimation other than 10.4 compatibility.

OTHER TIPS

There are some cases where Core Animation is not suitable. For example, you can't put a WebView in a layer-backed view without funky things happening.

Also, text fields in layer-backed views don't use subpixel anti-aliasing, which can be a deal breaker.

If you're not using layer-backed views then your example of just using the animatable property support is definitely easier than using NSAnimation.

If you need to get window screenshot later (as example, to make transition animation between two window states), the Core Animated views (view with CAAnimation) may not been grabbed. But CAAnimation is always working fast, and NSAnimation may slowing if CPU is too busy.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top