Skip to content

Commit 06f8ad7

Browse files
authored
style(iOS): swiftlint lint --fix (#46)
1 parent 65e9925 commit 06f8ad7

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

ios/implementation/EventManager.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77

88
import Foundation
99

10-
@objc public class EventManager : NSObject {
11-
@objc public weak var delegate: OrientationEventEmitterDelegate? = nil
10+
@objc public class EventManager: NSObject {
11+
@objc public weak var delegate: OrientationEventEmitterDelegate?
1212

1313
func sendDeviceOrientationDidChange(orientationValue: Int) {
1414
guard let delegate = delegate else {
1515
return
1616
}
1717

18-
if (!delegate.isJsListening) {
18+
if !delegate.isJsListening {
1919
return
2020
}
2121

@@ -28,20 +28,20 @@ import Foundation
2828
return
2929
}
3030

31-
if (!delegate.isJsListening) {
31+
if !delegate.isJsListening {
3232
return
3333
}
3434

3535
let params = Dictionary(dictionaryLiteral: ("orientation", orientationValue))
3636
delegate.sendEvent(name: Event.InterfaceOrientationDidChange.rawValue, params: params as NSDictionary)
3737
}
38-
38+
3939
func sendLockDidChange(value: Bool) {
4040
guard let delegate = delegate else {
4141
return
4242
}
4343

44-
if (!delegate.isJsListening) {
44+
if !delegate.isJsListening {
4545
return
4646
}
4747

@@ -65,6 +65,6 @@ public extension EventManager {
6565
}
6666

6767
@objc static var supportedEvents: [String] {
68-
return Event.allCases.map(\.rawValue);
68+
return Event.allCases.map(\.rawValue)
6969
}
7070
}

ios/implementation/OrientationDirectorImpl.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import Foundation
99
import UIKit
1010

11-
@objc public class OrientationDirectorImpl : NSObject {
11+
@objc public class OrientationDirectorImpl: NSObject {
1212
private static let TAG = "OrientationDirectorImpl"
1313

1414
private let bundleManager: BundleManager = BundleManager()
@@ -62,16 +62,16 @@ import UIKit
6262

6363
updateIsLockedTo(value: true)
6464

65-
let orientationCanBeUpdatedDirectly = jsOrientation != Orientation.LANDSCAPE;
66-
if (orientationCanBeUpdatedDirectly) {
65+
let orientationCanBeUpdatedDirectly = jsOrientation != Orientation.LANDSCAPE
66+
if orientationCanBeUpdatedDirectly {
6767
updateLastInterfaceOrientationTo(value: jsOrientation)
6868
return
6969
}
7070

7171
let lastInterfaceOrientationIsAlreadyInLandscape = lastInterfaceOrientation == Orientation.LANDSCAPE_RIGHT || lastInterfaceOrientation == Orientation.LANDSCAPE_LEFT
72-
if (lastInterfaceOrientationIsAlreadyInLandscape) {
72+
if lastInterfaceOrientationIsAlreadyInLandscape {
7373
updateLastInterfaceOrientationTo(value: lastInterfaceOrientation)
74-
return;
74+
return
7575
}
7676

7777
let systemDefaultLandscapeOrientation = Orientation.LANDSCAPE_RIGHT
@@ -92,20 +92,20 @@ import UIKit
9292

9393
let lastMask = utils.convertToMaskFrom(jsOrientation: lastInterfaceOrientation)
9494
let isLastMaskSupported = self.supportedInterfaceOrientations.contains(lastMask)
95-
if (isLastMaskSupported) {
95+
if isLastMaskSupported {
9696
return
9797
}
9898

9999
let supportedInterfaceOrientations = bundleManager.getSupportedInterfaceOrientations()
100-
if (supportedInterfaceOrientations.contains(UIInterfaceOrientationMask.portrait)) {
100+
if supportedInterfaceOrientations.contains(UIInterfaceOrientationMask.portrait) {
101101
self.updateLastInterfaceOrientationTo(value: Orientation.PORTRAIT)
102102
return
103103
}
104-
if (supportedInterfaceOrientations.contains(UIInterfaceOrientationMask.landscapeRight)) {
104+
if supportedInterfaceOrientations.contains(UIInterfaceOrientationMask.landscapeRight) {
105105
self.updateLastInterfaceOrientationTo(value: Orientation.LANDSCAPE_RIGHT)
106106
return
107107
}
108-
if (supportedInterfaceOrientations.contains(UIInterfaceOrientationMask.landscapeLeft)) {
108+
if supportedInterfaceOrientations.contains(UIInterfaceOrientationMask.landscapeLeft) {
109109
self.updateLastInterfaceOrientationTo(value: Orientation.LANDSCAPE_LEFT)
110110
return
111111
}
@@ -128,7 +128,7 @@ import UIKit
128128

129129
private func initIsLocked() -> Bool {
130130
let supportedOrientations = bundleManager.getSupportedInterfaceOrientations()
131-
if (supportedOrientations.count > 1) {
131+
if supportedOrientations.count > 1 {
132132
return false
133133
}
134134

@@ -169,11 +169,11 @@ import UIKit
169169

170170
private func adaptInterfaceTo(deviceOrientation: Orientation) {
171171
let supportsLandscape = self.supportedInterfaceOrientations.contains(.landscape)
172-
if (isLocked && !supportsLandscape) {
172+
if isLocked && !supportsLandscape {
173173
return
174174
}
175175

176-
if (deviceOrientation == Orientation.FACE_UP || deviceOrientation == Orientation.FACE_DOWN) {
176+
if deviceOrientation == Orientation.FACE_UP || deviceOrientation == Orientation.FACE_DOWN {
177177
return
178178
}
179179

ios/implementation/SensorListener.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import Foundation
99

1010
public class SensorListener {
11-
private var onOrientationDidChangeCallback: ((_ deviceOrientation: UIDeviceOrientation) -> Void)? = nil
11+
private var onOrientationDidChangeCallback: ((_ deviceOrientation: UIDeviceOrientation) -> Void)?
1212

1313
init() {
1414
NotificationCenter.default.addObserver(

ios/implementation/Utils.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Utils {
1313

1414
// TODO: Add .unknown
1515
public func convertToOrientationFrom(uiInterfaceOrientation: UIInterfaceOrientation) -> Orientation {
16-
switch(uiInterfaceOrientation) {
16+
switch uiInterfaceOrientation {
1717
case .landscapeRight:
1818
return .LANDSCAPE_RIGHT
1919
case .portraitUpsideDown:
@@ -26,7 +26,7 @@ class Utils {
2626
}
2727

2828
public func convertToOrientationFrom(deviceOrientation: UIDeviceOrientation) -> Orientation {
29-
switch(deviceOrientation) {
29+
switch deviceOrientation {
3030
case .landscapeRight:
3131
return .LANDSCAPE_RIGHT
3232
case .portraitUpsideDown:
@@ -43,7 +43,7 @@ class Utils {
4343
}
4444

4545
public func convertToOrientationFrom(jsValue: NSNumber) -> Orientation {
46-
switch(jsValue) {
46+
switch jsValue {
4747
case 2:
4848
return .LANDSCAPE_RIGHT
4949
case 3:
@@ -62,7 +62,7 @@ class Utils {
6262
https://developer.apple.com/documentation/uikit/uiviewcontroller/1621435-supportedinterfaceorientations
6363
*/
6464
public func convertToMaskFrom(jsOrientation: Orientation) -> UIInterfaceOrientationMask {
65-
switch(jsOrientation) {
65+
switch jsOrientation {
6666
case .PORTRAIT:
6767
return .portrait
6868
case .LANDSCAPE_RIGHT:
@@ -83,7 +83,7 @@ class Utils {
8383
return UIInterfaceOrientation.unknown
8484
}
8585

86-
return windowScene.interfaceOrientation;
86+
return windowScene.interfaceOrientation
8787
}
8888

8989
/* This function is needed to get the current available window.

0 commit comments

Comments
 (0)