Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any reason to use NSViewAnimation over CoreAnimation techniques?

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).

like image 563
jbrennan Avatar asked Sep 14 '09 23:09

jbrennan


2 Answers

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.

like image 53
Rob Napier Avatar answered Dec 19 '22 07:12

Rob Napier


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.

like image 32
Rob Keniger Avatar answered Dec 19 '22 07:12

Rob Keniger