Animating subView moving from one superview to another (MacOS)

  • Hello everyone.

    I need to add a certain animation to our application. I have two NSSplitViews in my window, each holding several "panels" (NSView hierarchies).

    I need to SWAP two panels in separate splitViews with each other. e.g. Child view index:2 of FirstSplitView will move to become child-view index 4 of SecondSplitView, and vice-versa.

    Without animation, this change can be irritating, and user can miss it (although he chose to do it from the menu).

    I saw a magnificent animation in Apple's "iMovie" - the two child-views "retreat" revealing empty space, then go into their new place using the famous "genie" effect transition.
    A stunning and helpful animation, which gave me the motivation to try...

    I tried to add animation to my normal code --- to no avail.

    I'm forced to use [NSSplitView setSubviews] on the NSSplitViews, to do the actual  swapping, in order to maintain the order of all other panels which don't move.

    I tried to call the animator proxies of the NSSplitViews, but It seems that NSSplitView only uses "Fade" animation when adding/removing/replacing subviews.
    I cannot use "frame" animation (position/bounds) on the moving sub-views, because they need to change their parent views, and they would simply disappear when I will try to "move" them around, because they fill up all their suprview (NSSplitView).

    Any help would be appreciated.
    Thanks!
    Motti Shneor.
previous month june 2012 next month
MTWTFSS
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30  
Go to today