mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Use true north for device orientation when available
This commit is contained in:
parent
3778357baa
commit
4d7b522d2a
@ -2246,7 +2246,11 @@ public final class WebAppController: ViewController, AttachmentContainable {
|
|||||||
|
|
||||||
var effectiveIsAbsolute = false
|
var effectiveIsAbsolute = false
|
||||||
let referenceFrame: CMAttitudeReferenceFrame
|
let referenceFrame: CMAttitudeReferenceFrame
|
||||||
if absolute && CMMotionManager.availableAttitudeReferenceFrames().contains(.xMagneticNorthZVertical) {
|
|
||||||
|
if absolute && [.authorizedWhenInUse, .authorizedAlways].contains(CLLocationManager.authorizationStatus()) && CMMotionManager.availableAttitudeReferenceFrames().contains(.xTrueNorthZVertical) {
|
||||||
|
referenceFrame = .xTrueNorthZVertical
|
||||||
|
effectiveIsAbsolute = true
|
||||||
|
} else if absolute && CMMotionManager.availableAttitudeReferenceFrames().contains(.xMagneticNorthZVertical) {
|
||||||
referenceFrame = .xMagneticNorthZVertical
|
referenceFrame = .xMagneticNorthZVertical
|
||||||
effectiveIsAbsolute = true
|
effectiveIsAbsolute = true
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user