I would like to animate while resizing NSSplitView programatically.
Here is the code for resizing the view in SplitView
In awakeFromNib: Iam observing the NSSplitViewWillResizeSubviewsNotification
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(splitViewWillResizeSubviewsHandler:)
name:NSSplitViewWillResizeSubviewsNotification
object:splitView];
SplitView Resize
NSView * leftSubView = [[splitView subviews] objectAtIndex:0];
if ([leftSubView isHidden])
{
[leftSubView setHidden:NO];
[splitView setPosition:0 ofDividerAtIndex:0];
}
else
{
[leftSubView setHidden:YES];
}
[splitView adjustSubviews];
[[NSNotificationCenter defaultCenter] postNotificationName:NSSplitViewWillResizeSubviewsNotification object:self userInfo:nil];
I am able to resize the splitView.Where should I add the animationCode.(As rightView moves to replace the leftSubView, I want the resize happen with some delay) ?
I have the rects of the two Views before and after the resize.Where should I write the animation Code.
Iam able to solve the animations. Following Code works for me
Following Link helped me in solving the issue
How to expand and collapse NSSplitView subviews with animation?