iOS16 beta bug? Malfunction in applying interface orientation changes

In iOS16 beta7, I found an issue where changing the interface orientation in unwind segue back from a child ViewController causes inconsistencies between the on-screen appearance and the internal behavior.

  • viewWillTransitionToSize is not called.
  • windowScene.interfaceOrientation is not updated

I have a UIKit based app and it works fine up to iOS15.
- It has a ViewController (VC1) that has a settings screen as a child ViewController (VC2).
- The screen orientation of VC1 is fixed to either portrait or landscapeR according to the mode set in VC2.
- In order to reflect the mode change in VC2, the return value of VC1's supportedInterfaceOrientations is changed according to the mode in the unwind segue from VC2 back to VC1.

In iOS16, I noticed that after setting supportedInterfaceOrientations to one direction only, the changes are no longer reflected because supportedInterfaceOrientations is no longer called. So I added a call of setNeedsUpdateOfSupportedInterfaceOrientations, which improved many situations.

So now the process in the unwind segue from VC2 back to VC1 is as follows
- Change the return value of supportOfSupportedInterfaceOrientations according to the mode setting
- And if iOS>=16.0 , call setNeedsUpdateOfSupportedInterfaceOrientations.

With iOS15 there is no problem.
【Appearance】 When going back from VC2 to VC1, VC1 is shown in the changed orientation from the beginning. The transition animation is also presented in the changed orientation.
【Internal state】 viewWillTransitionToSize is called before viewWillAppear in VC1 to get the size after the orientation change. And the correct orientation can be obtained by self.view.window.windowScene.interfaceOrientation after viewWillLayoutSubviews.

However, the following problems are currently occurring in iOS16 beta7.
【Appearance】 When going back from VC2 to VC1, VC1 is shown in the changed orientation from the beginning. The transition animation is also presented in the changed orientation. But, the displayed contents are broken.
【Internal state】 (1) viewWillTransitionToSize in VC1 is not called at all. And (2) self.view.window.windowScene.interfaceOrientation is not updated at all and remains at the old value.
→ Therefore, (1) view size cannot be updated and does not match the actual screen, and (2) the interface orientation obtained in (2) is also old and does not match the actual screen.
→ As a result, the screen adjusted and drawn based on (1) and (2) will be broken.

I think this is a bug in IOS16 beta.
It's not a spec change, is it?
Does anyone have any information on this issue?

It was the same with beta8.

The same for me. viewWillTransitionToSize in iOS 16 is not being called if I present a full screen modal controller that changes interface orientation. The rootViewController does not receive viewWillTransitionToSize when I dismiss the modal. In iOS 15 it works as expected.

It was the same with iOS16RC.

Note that I found that the problem with windowScene.interfaceOrientation in this case is that the update timing is too late. It seems that it is not updated to the correct value until about 20-50 ms after viewDidAppear.
viewWillTransitionToSize is not called no matter how long I wait.

Is Apple not willing to fix this issue?

iOS16 beta bug? Malfunction in applying interface orientation changes
 
 
Q