preferredInterfaceOrientationForPresentation is invalid in iOS16 bate version

I know that the horizontal and vertical screen switching has changed in iOS16, [[UIDevice currentDevice] setValue:@(UIDeviceOrientationUnknown) forKey:@"orientation"] is replaced by [UIWindowScene requestGeometryUpdateWithPreferences].

However, the preferredInterfaceOrientationForPresentation method is outrageous in iOS16. In iOS16, if 'presentViewController:' + [UIWindowScene requestGeometryUpdateWithPreferences] goes to a ViewController, rewriting preferredInterfaceOrientationForPresentation in ViewController to return the orientation for the first presentation will not take effect.

For example, first, the program supports horizontal and vertical screens, [vcA presentViewController:vcB animated:YES completion:nil] + [UIWindowScene requestGeometryUpdateWithPreferences:nil] + [vcB setNeedsUpdateOfSupportedInterfaceOrientations]. vcA is currently in portrait, you want vcB to be displayed in landscape for the first time, rewrite in vcB - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { return UIInterfaceOrientationLandscapeLeft; } + - (UIInterfaceOrientationMask)supportedInterfaceOrientations{ return UIInterfaceOrientationMaskAllButUpsideDown; }; Vertical screen, but it is normal in versions before iOS16.

preferredInterfaceOrientationForPresentation is invalid in iOS16 bate version
 
 
Q