How to make a transition using PresentViewController from right to left and dissmissViewController for it vice versa?

to go from one viewController to another view, I wrote the code below, like this

if (UIInterfaceOrientationIsLandscape(STATUSBAR_ORIENTATION)) { transition = [CATransition animation]; transition.duration = 0.3; transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; transition.type = kCATransitionPush; transition.subtype = kCATransitionFromBottom; [self.view.window.layer addAnimation:transition forKey:nil]; } else { transition = [CATransition animation]; transition.duration = 0.3; transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; transition.type = kCATransitionPush; transition.subtype = kCATransitionFromLeft; [self.view.window.layer addAnimation:transition forKey:nil]; } [self presentViewController:webView animated:NO completion:nil]; 

It works fine, but when I rotate in landscape orientation to the portrait at that time, switching to the right-to-left mode comes up, how to resolve it ... please help me

+6
source share

Source: https://habr.com/ru/post/977474/


All Articles