Collapse NSWindow using CoreAnimation

So, I'm pretty new to AppKit and Cocoa (from UIKit with CocoaTouch), and I'm currently implementing an interface to reset NSWindow. On iOS, that would be pretty easy, but seeing how many small differences are from OS X, I want to ask.

How are you going to implement the next transition?

Window fold

Note. The bottom panel is part of my contentView, not the OS X bottom panel. That is, my window (INAppStoreWindow by the way) consists of a titleBar and a contentView.

I think I could just minimize the contentView and resize the window synchronously, but it would be preferable if I could maintain transparency during bending, which is due to the zoom perspective. That is, the sides that are curved inward should (during the transition) be transparent. Or am I overdoing it?

+5
source share
1 answer

: UIKit, AppKit Core Animation . CALayers NSView . , , CAAnimations (, , . ).

, Core Animation. , . NSWindow, , , . ( ), , :

 - (id) initWithContentRect: (NSRect) contentRect
                 styleMask: (unsigned int) aStyle
                   backing: (NSBackingStoreType) bufferingType
                     defer: (BOOL) flag
{
    if (![super initWithContentRect: contentRect 
                             styleMask: NSBorderlessWindowMask 
                          backing: bufferingType 
                         defer: flag]) return nil;
    [self setBackgroundColor: [NSColor clearColor]];
    [self setOpaque:NO];

    return self;
}
+2

All Articles