Have anyone experienced same error log in related with view controller orientation in iOS16?

520 views Asked by At

I know that I should use supportedInterfaceOrientations and setNeedsUpdateOfSupportedInterfaceOrientation method instead of shouldAutorotate and attemptRotationToDeviceOrientation.

Above reason, I removed all deprecated APIs and test logic to dismiss two view controllers at the same time like below.

// MainViewController present FirstViewController.
final class MainViewController {
    override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
        .allButUpSideDown
    }
}

// FirstViewController has only portrait orientation. FirstViewController present SecondViewController.
final class FirstViewController {
    override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
        .portrait
    }
}

// Last view controller in view hierarchy.
final class SecondViewController {
    override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
        .allButUpSideDown
    }
}

// In result, above view controllers's hierarchy like below.
// MainViewController(allButUpSideDown)
// -- FirstViewController(portrait)
// ----SecondViewController(allButUpSideDown)
// And I call the method to dismiss first and second view controller at the same time.

func dismissAllViewControllers() {
    firstViewController.dismiss(animated: false) {
        firstViewController.dismiss(animated: true)
    }
}

And I called method and see MainViewController screen like below. ugly status bar and MainViewController can't be rotated automatically.

To be is MainViewController will be rotated to landscape but system give me error log like below.

A new orientation transaction token is being requested while a valid one already exists. reason=Fullscreen transition (dismissing): fromVC=<HyunjinTutorialProject.PortraitViewController: 0x109606d60>; toVC=<HyunjinTutorialProject.MainNavigationViewController: 0x10801fe00>;; windowOrientation=portrait; sceneOrientation=landscapeRight; existingTransaction=<_UIForcedOrientationTransactionToken: 0x282fd2ee0; state: committing; originalOrientation: landscapeRight (3)>

Is iOS 16 UI Issue? Anyone experience same error log? Thank you.

0

There are 0 answers