我要實現新的方法,我搜索谷歌和StackOverflow上很多,但我還沒有找到一個例子動畫自定義演示
- (void)presentViewController:(NSViewController *)viewController animator:(id <NSViewControllerPresentationAnimator>)animator
這種方法是可用的OSX 10.10,這方法需要實現協議NSViewControllerPresentationAnimator
至極有這兩種方法
- (void)animatePresentationOfViewController:(NSViewController *)viewController fromViewController:(NSViewController *)fromViewController
- (void)animateDismissalOfViewController:(NSViewController *)viewController fromViewController:(NSViewController *)fromViewController
這種方法允許我們做自定義動畫之間的兩個NSViewController的 我需要實現的examople,我有這樣的代碼
- (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
{
}
任何人都可以幫助我舉一個例子,說明如何實現這個轉換 非常感謝。
有沒有更多的幫助,你需要或我的例子足夠? – 2014-11-04 12:06:48
是的,沒關係,你的答案解決了我的問題,非常感謝... – Imodeveloper 2014-11-04 14:54:31