IPad iPad Lock Notification?

Is there a way to get notified when the iPad becomes locked? When orientation lock is on or off, it sends a received Rotate: notification message, but I need it to be able to distinguish between normal rotations and "rotation" locks.

The problem is that I rotate things in my opinion when the rotation changes. When the lock is activated, the iPad sends the accepted Rotate: with a UIInterfaceOrientationPortrait.

I looked at the UIDevice for something like isOrientationLocked, but without success.

Thanks for any tips.

EDIT: When the iPad’s orientation lock is turned on, it sends a notification that the rotation has changed to a portrait for some reason. This makes the elements rotate, as they rotate with any change in orientation. This is what I want to prevent.

EDIT2: Yes, the iPad should not send portrait notification, but it is. After this delivery notification, the iPad stops sending notifications, which is the way it should be. This is just an initial notice that gets in the way.

I can’t use the accelerometer because I still want to use the orientation lock lock function. Maybe I would use an accelerometer if I knew when the iPad was locked.

EDIT3: receivedRotate: called with UIInterfaceOrientationPortrait for all orientations.

+3
2

-, .

XCode iPhone SDK, UIInterfaceOrientationPortrait, . , Apple.

+1

, , ? , ?

: - , , . .

, , , , , .

iPad, , , , , "", .

0

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


All Articles