I want to implement new method, I searched a lot on Google and Stack Overflow but I have not found an example.
- (void)presentViewController:(NSViewController *)viewController animator:(id <NSViewControllerPresentationAnimator>)animator
this method is available in OSX 10.10 and this method need to implement the protocol NSViewControllerPresentationAnimator
which has these two methods
- (void)animatePresentationOfViewController:(NSViewController *)viewController fromViewController:(NSViewController *)fromViewController
- (void)animateDismissalOfViewController:(NSViewController *)viewController fromViewController:(NSViewController *)fromViewController
These methods allow us to do custom animation between two NSViewController's I need an example of implementation, I have this code:
- (IBAction)openTask:(id)sender {
NSStoryboard *storyboard = [NSStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
Tasks *task = [storyboard instantiateControllerWithIdentifier:@"tasks"];
[self presentViewController:task animator:self];
}
- (void)animatePresentationOfViewController:(NSViewController *)viewController
fromViewController:(NSViewController *)fromViewController
{
}
- (void)animateDismissalOfViewController:(NSViewController *)viewController
fromViewController:(NSViewController *)fromViewController
{
}
Can anyone help me with an example of how I could have implemented this transition?