I'm doing an app for Mathematics lessons & exercices...
I have only coded the MainMenu, but I've got a problem. Indeed, I would like to know the current orientation to set up my stuff.
However, I tried different ways to know the current orientation, but I didn't succeed :
if UIDevice.current.orientation == UIDeviceOrientation.portrait {
NSLog("Portrait")
}
else if UIDevice.current.orientation == UIDeviceOrientation.landscapeRight || UIDevice.current.orientation == UIDeviceOrientation.landscapeRight {
NSLog ("Landscape")
}
I also see this answer, but it's not working (or maybe I haven't understood well) : Getting device orientation in Swift , bu
I would like to specify that I'm in UIViewController in the ViewDidLoad().
Thanks for your help