IPad launch orientation detection

I am developing an application that will display a splash screen on the first page of the application. This splash screen should flow seamlessly from the Default-X.png image from the application. This works fine for me, except for one special situation.

If the user clicks on the application icon, then IMMEDIATELY changes the orientation; automatically, by default, X.png will exit the original orientation (as expected), but my program-specific opening image appears in the new orientation. (I think this is also expected, now I think about it.)

My question is how can I get the actual launch orientation. NOT the orientation that is available when you run the application delegate, but the orientation of the device when you click on the application icon, as well as the orientation that the OS uses to determine the Default-X.png image.

Thank.

+3
source share
2 answers

I think this question is related to: orientation of launching iPad with flat problems in application deletion

I am also looking for a solution.

+1
source

I spent several hours on it, then I found it, and it saved me.

[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
UIInterfaceOrientation orientation = [UIDevice currentDevice].orientation;
0
source

Source: https://habr.com/ru/post/1756476/


All Articles