Кажется, что когда мое приложение загружается, оно не знает его текущей ориентации:
UIInterfaceOrientation orientation = [[UIDevice currentDevice] orientation];
if (orientation == UIDeviceOrientationPortrait) {
NSLog(@"portrait");// only works after a rotation, not on loading app
}
Как только я поворачиваю устройство, я получаю правильную ориентацию, но когда я загружаю приложение, не изменяя ориентацию, кажется, что использование [[UIDevice currentDevice] orientation]
не знает текущей ориентации.
Есть ли другой способ проверить это при первом загрузке моего приложения?