How to install NSView hidden in FadeOut animation in cocoa?

I hide the preview from the CustomView element with the following code:

[[[theViewcont subviews] objectAtIndex:0] setHidden:TRUE] 

How can I add fade animation to hide this NSVIEW?

+4
source share
1 answer

Found a solution HERE CocoaDev: CoreAnimation

so when you have something like this to hide your view:

 [[[theViewcont subviews] objectAtIndex:0] setAlphaValue:0.0];
[[[theViewcont subviews] objectAtIndex:0] setAlphaValue:0.0]; 

to revive this action, you just need the following addition:

 [[[[theViewcont subviews] objectAtIndex:0] animator] setAlphaValue:0.0];
[[[[theViewcont subviews] objectAtIndex:0] animator] setAlphaValue:0.0]; 

so you have the right way to fade out subview con Cocoa

+20
source

All Articles