I'm currently putting the final touches on a project.
A lot (if not all) of the UI logic currently relies on Cocoa Bindings. Some of the user interface elements (labels, buttons, etc.) have their "Hidden" bindings defined. When certain events are triggered, these elements visibility is toggled.
I'm trying to animate the visibility change (by animating the opacity and maybe even the scale). This could easily be accomplished in a number of ways, either by setting the relevant layer properties, adding the animations to the layer, etc. However, since I'm trying to totally rely on the bindings behavior I "can't" really do this directly.
I tried an implementation using Layer actions, by defining actions for the keys kCAOnOrderIn
and kCAOnOrderOut
on the relevant elements, but it really didn't work, as the setHidden:
is most likely being triggered on the NSView
instead of the CALayer
-- which makes sense.
So, my question is: how would you animate setHidden:
on a NSView, when setHidden:
is being invoked by the Cocoa Bindings.
Thank you.
This will fade out an NSView...
[[someView animator] setAlphaValue:0.0f];
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