Orientation check

Is there a way to know if the user rotates the device without allowing him to change orientation.
I would like to rotate some controls (canvas), so they wont be upside down, but I did not find any solution to check the orientation.

This should help:

[code]
declare function NSClassFromString lib “Foundation.Framework” (clsName as CFStringRef) as ptr
declare function currentDevice_ lib “UIKit.framework” selector “currentDevice” (clsRef as ptr) as ptr
declare function orientation_ lib “UIKit.framework” selector “orientation” (obj_id as ptr) as integer
Dim ori As Integer = orientation_(currentDevice_(NSClassFromString(“UIDevice”)))
Select Case ori
Case 0
//unknown
Case 1
//portrait
Case 2
//protraitUpsideDown
Case 3
//landscapeleft
Case 4
//landscapeRight
Case 5
//faceUp
Case 6
//faceDown

End Select[/code]

More information here: https://developer.apple.com/reference/uikit/uideviceorientation

Thank you, works well.