mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Use Swift 5.7 if-let style
This commit is contained in:
@@ -21,7 +21,7 @@ struct Orientation {
|
||||
static func lockOrientation(_ orientation: UIInterfaceOrientationMask, andRotateTo rotateOrientation: UIInterfaceOrientation? = nil) {
|
||||
lockOrientation(orientation)
|
||||
|
||||
guard let rotateOrientation = rotateOrientation else {
|
||||
guard let rotateOrientation else {
|
||||
return
|
||||
}
|
||||
|
||||
|
@@ -59,7 +59,7 @@ public class OrientationTracker {
|
||||
public func startDeviceOrientationTracking() {
|
||||
motionManager.startAccelerometerUpdates(to: queue) { accelerometerData, error in
|
||||
guard error == nil else { return }
|
||||
guard let accelerometerData = accelerometerData else { return }
|
||||
guard let accelerometerData else { return }
|
||||
|
||||
let newDeviceOrientation = self.deviceOrientation(forAccelerometerData: accelerometerData)
|
||||
guard newDeviceOrientation != self.currentDeviceOrientation else { return }
|
||||
|
Reference in New Issue
Block a user