I have a screen rotation problem on iOS16. I found that it can be improved by adding the following processing.
if (@available(iOS 16.0, *)) { UIWindowScene *windowScene = (UIWindowScene *)[[[UIApplication sharedApplication] connectedScenes] allObjects].firstObject; UIViewController *rootView = [[windowScene keyWindow] rootViewController]; [rootView setNeedsUpdateOfSupportedInterfaceOrientations]; }
It worked fine when built with XCode14. But it also worked fine when built with XCode13. Why is this? Can "setNeedsUpdateOfSupportedInterfaceOrientations" be used without XCode14?