Forcing orientation on a full screen modal doesn't work on parent controller

iOS 16 introduced a new API for forcing orientation changes, which implies using the requestGeometryUpdate(_:errorHandler:).

It seems that it's not working as expected when using a full screen modal.

For example, let's say we have an app that locks the orientation in portrait mode except for a modally presented controller, a parent controller A and a modal controller B :

  1. A is displayed
  2. We put the device in landscape mode - A stays in portrait mode
  3. B is opened modally fullscreen from A
  4. B is displayed in landscape
  5. B has a button to go back to portrait mode using the requestGeometryUpdate(_:errorHandler:)
  6. B is dismissed through a button
  7. A ends up in landscape

In the app delegate, we used supportedInterfaceOrientationsFor to force the app in portait mode except for the controller B.

We tried to call setNeedsUpdateOfSupportedInterfaceOrientations every time we call requestGeometryUpdate(_:errorHandler:). We also tried to call it on the viewWillAppear from the controller A. We finally tried to call requestGeometryUpdate(_:errorHandler:) from the controller A's viewWillAppear, without any luck as well.

Is this a bug in iOS 16 or are we missing something ? It seems to be working as expected when displaying the modal over the current context, but it's not what we want in this case.

I can provide an example project if needed.

Forcing orientation on a full screen modal doesn't work on parent controller
 
 
Q