如何翻转两个视图Objective C iOS 13

问题描述

我有两个翻转的视图(例如在卡上水平翻转)。 iOS 13已贬值了开始动画代码,我正在尝试找出如何使用[UIView animateWithDuration:delay:options:animations:completion:]

CGContextRef context = UIGraphicsGetCurrentContext();
[UIView beginAnimations:nil context:context];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:1.0];

[UIView setAnimationTransition: UIViewAnimationTransitionFlipFromLeft forView:self.ABCard cache:YES];

[self.ABCard exchangeSubviewAtIndex:0 withSubviewAtIndex:1];
[UIView setAnimationDelegate:self];
[UIView commitAnimations];

我正在尝试执行以下操作,但是动画只是在没有翻转动作的情况下立即切换视图。

 [UIView animateWithDuration:1.0 delay:1.0
                        options: UIViewAnimationCurveEaseInOut | UIViewAnimationTransitionFlipFromLeft
                     animations:^{
        [self.ABCard exchangeSubviewAtIndex:0 withSubviewAtIndex:1];
                           } completion:^(BOOL finished){
                           }];

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)