IPhone - screen rotation?

What is the difference between UIDeviceOrientationand UIInterfaceOrientation?

Which one should be used to detect rotation on a UIView?

+3
source share
2 answers

UIDeviceOrientationprovides information about the physical device itself, and UIInterfaceOrientation- about the orientation of the displayed views. They must not match; when the user uses orientation lock or device orientation face up.

You probably want to check UIInterfaceOrientationrotation methods on UIViewControllerto determine whether they were scanned or should be rotated.

+8
source

UIDeviceOrientation , UIInterfaceOrientation .

, autoResizeMask, . . http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIDevice_Class/Reference/UIDevice.html

- .

UIDEVICE

UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation]
+2

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


All Articles