3

ページ カール アニメーションを使用してビュー コントローラーをプッシュしようとしています。動作するカスタム セグエを作成しました。

- (void) perform {

UIViewController *src = (UIViewController *) self.sourceViewController;
UIViewController *dst = (UIViewController *) self.destinationViewController;    

[UIView transitionFromView:src.view
                    toView:dst.view
                  duration:0.6
                   options:UIViewAnimationOptionTransitionCurlUp
                completion:^(BOOL finished) {
                    [src.navigationController pushViewController:dst animated:NO];
                }
 ];
}

カールの方向を変えようとすると問題が発生します。here で説明されているように、多かれ少なかれコンテナを使用してみました。しかし、それを機能させることもできません。

- (void) perform
{
    
    UIViewController *src = (UIViewController *) self.sourceViewController;
    UIViewController *dst = (UIViewController *) self.destinationViewController;    
    
    UIView* parent = src.navigationController.view;
    UIView* containerView = [[UIView alloc] initWithFrame:parent.frame];
    
    [parent addSubview:containerView];
    containerView.transform = CGAffineTransformMakeRotation(M_PI);
    [containerView addSubview:src.view];
    src.view.transform = CGAffineTransformMakeRotation(-M_PI);
    
    [UIView transitionFromView:containerView
                        toView:dst.view
                      duration:0.6
                       options:UIViewAnimationOptionTransitionCurlUp
                    completion:^(BOOL finished) {
                        [src.navigationController pushViewController:dst animated:NO];
                    }
     ];
}

これはまったく可能ですか?

ありがとう。

4

0 に答える 0