Change mobile game screen orientation dynamicly?

Hi, I find an game can only dynamicly change it’s landscape orientation in Left/Right mode,and portrait orientation in Up/Down mode . So I wonder what limited the engine can’t dynamicly change screen from landscape to portrait? Is it possible to achieve this in code? there are only few lines of code about orientation

in IOSAppDelegate.cpp:


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
    // save launch options
    self.launchOptions = launchOptions;

#if PLATFORM_TVOS
    self.bDeviceInPortraitMode = false;
#else
    // use the status bar orientation to properly determine landscape vs portrait
    self.bDeviceInPortraitMode = UIInterfaceOrientationIsPortrait([UIApplication sharedApplication] statusBarOrientation]);
    printf("========= This app is in %s mode
", self.bDeviceInPortraitMode ? "PORTRAIT" : "LANDSCAPE");
#endif

If an game use status bar orientation to determine landscaoe or portrait, is it possible to set status bar orientation and How to do this in game’s code?
find a function in apple developer’s page:


func setStatusBarOrientation(_ interfaceOrientation: [UIInterfaceOrientation](https://developer.apple.com/documentation/uikit/uiinterfaceorientation), animated: [Bool](https://developer.apple.com/documentation/swift/bool))

and if for a TopDown game is it possible only ratate camera to change orientation and set the orientation of Home Indicator Bar for iPhone X?

please help me if you have any idea, Thank you!

Thank you for your reply.
I’m a novice developer,What you said is too abstract for me to understand.Does have a processing method like Android Or give me an example. Thank you.

Can you give me some ideas to chang Orientation on?