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).
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.
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 love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With