[UIDevice.currentDevice setValue:@(UIInterfaceOrientationPortrait) forKey:@"orientation"];
ios14.6 The code for rotating the screen does not take effect
Add a Comment
[UIDevice.currentDevice setValue:@(UIInterfaceOrientationPortrait) forKey:@"orientation"];
Setting the orientation property of UIDevice is not supported. Consider using the supportedInterfaceOrientations property of UIViewController to control orientations instead.