Animating an NSView frame, then jumping to specific frame
I'm trying to slide a gridded NSView
up, revealing another row from another NSView
. Then, once the animation is done, the second NSView
will dissapear, and the first will immediately move back to its original position with the new data.
It works 4/5s of the time. The only error I'm getting is when the first view doesn't reset to the original position; it stays were the animation finishes.
Here's the basic idea (I don't have the code here):
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){
[[myView animator] setFrame:newPos];
} completionHandler:^{
[myView setFrame:originalPos];
}];
I'm having trouble Googling since ru开发者_开发百科nAnimationGroup:completionHandler
is new in Lion.
精彩评论