Я пытаюсь захватить, когда изменяется UIInterfaceOrientation. Я знаю, как это сделать с помощью UIDeviceOrientation, но я хочу предотвратить что-либо, кроме пейзажа слева/справа и портрет.Как получить устройства UIInterfaceOrientation
Я использовал UIDeviceOrientation, но каждый раз, когда я положил его на лицо, все сошло с ума от моего приложения.
Так что я хотел бы знать, как сделать что-то вроде этого
UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
UIInterfaceOrientation interfaceOrientation = [[UIApplication sharedApplication] statusBarOrientation];
CGFloat screenHeight = [[UIScreen mainScreen] bounds].size.height;
CGFloat screenWidth = [[UIScreen mainScreen] bounds].size.width;
if (interfaceOrientation landscape) {
if (orientation == UIDeviceOrientationLandscapeLeft)
{
}
else if (orientation == UIDeviceOrientationLandscapeRight)
{
}
}
if (interfaceOrientation Portrait) {
}
, так что я только смотреть на любой пейзаж или портрет.
всякая помощь была бы принята с благодарностью.