I\'m developing an app where when clicking to a button, custom view should slide from a side. Actually just a window appears, but I\'d like to have something like iOS naviga
NSView *view = yourview;
view.wantsLayer = YES;
// Set the layer redraw policy. This would be better done in the initialization method of a NSView subclass instead of here.
view.layerContentsRedrawPolicy = NSViewLayerContentsRedrawOnSetNeedsDisplay;
Then,
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context)
{
context.duration = 2.f;
view.animator.frame = CGRectOffset(view.frame, 180, 0);
}
completionHandler:^{
view.hidden = YES;
}];