Merge pull request #569 from stonerl/no-180-rotation

disable portraitUpsideDown on iPhones
This commit is contained in:
Arkadiusz Fal 2023-12-09 21:03:14 +01:00 committed by GitHub
commit d6c04540e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,9 +86,11 @@ public class OrientationTracker {
if accelerometerData.acceleration.y <= -threshold {
return .portrait
}
if accelerometerData.acceleration.y >= threshold {
if UIDevice.current.userInterfaceIdiom == .pad && accelerometerData.acceleration.y >= threshold {
return .portraitUpsideDown
}
return currentDeviceOrientation
}
}