Tôi muốn thực hiện phương pháp mới, tôi đã tìm kiếm rất nhiều trên Google và StackOverflow nhưng tôi đã không tìm thấy một ví dụAnimate tùy chỉnh trình bày của ViewController trong OS X Yosemite
- (void)presentViewController:(NSViewController *)viewController animator:(id <NSViewControllerPresentationAnimator>)animator
phương pháp này là có sẵn trong OSX 10.10 và điều này phương pháp cần phải thực hiện các giao thức NSViewControllerPresentationAnimator
Mà có này hai phương pháp
- (void)animatePresentationOfViewController:(NSViewController *)viewController fromViewController:(NSViewController *)fromViewController
- (void)animateDismissalOfViewController:(NSViewController *)viewController fromViewController:(NSViewController *)fromViewController
phương pháp này cho phép chúng ta làm phim hoạt hình tùy chỉnh giữa hai NSViewController của tôi cần một examople thực hiện, tôi có mã này
- (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
{
}
Bất kỳ ai có thể giúp tôi làm ví dụ về cách tôi có thể triển khai quá trình chuyển đổi này Cảm ơn rất nhiều.
Bạn có cần thêm trợ giúp hoặc ví dụ của tôi đủ không? –
vâng, OK, câu trả lời của bạn đã giải quyết được vấn đề của tôi, cảm ơn rất nhiều ... – Imodeveloper