Lock orientation for a specific scene

Hi everyone

I’m playing with accelerometer, and I would like to know if there is a way to lock the device orientation for a specific scene and not for the whole application ?
I want to disable the autorotation behavior only during the part of the app when the accelerometer is in use.
And would this temporary lock of device orientation be accepted by Apple when submitting to the AppStore ?

Thanks

On iOS the best I found is to use a variable that you set in scenes where you don’t want orientation to change, and use that variable in the function shouldAutorotateToInterfaceOrientation in RootViewController.mm