Merge branch 'main' into use-mpvkit

This commit is contained in:
Arkadiusz Fal
2023-09-23 16:17:33 +02:00
committed by GitHub
104 changed files with 601 additions and 1063 deletions

View File

@@ -79,14 +79,16 @@ public class OrientationTracker {
let threshold = 0.55
if accelerometerData.acceleration.x >= threshold {
return .landscapeLeft
} else if accelerometerData.acceleration.x <= -threshold {
return .landscapeRight
} else if accelerometerData.acceleration.y <= -threshold {
return .portrait
} else if accelerometerData.acceleration.y >= threshold {
return .portraitUpsideDown
} else {
return currentDeviceOrientation
}
if accelerometerData.acceleration.x <= -threshold {
return .landscapeRight
}
if accelerometerData.acceleration.y <= -threshold {
return .portrait
}
if accelerometerData.acceleration.y >= threshold {
return .portraitUpsideDown
}
return currentDeviceOrientation
}
}