Skip to content

Commit 8248762

Browse files
committed
[nit] run swiflint
1 parent a90478c commit 8248762

File tree

3 files changed

+19
-20
lines changed

3 files changed

+19
-20
lines changed

iOS_SDK/OneSignalSDK/OneSignalCoreMocks/MockOSDispatchQueue.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import OneSignalOSCore
3030
public class MockDispatchQueue: OSDispatchQueue {
3131
let requestDispatch = DispatchQueue(label: "MockDispatchQueue")
3232
var numDispatches = 0
33-
33+
3434
public init() {}
3535

3636
public func async(execute work: @escaping @convention(block) () -> Void) {
@@ -46,8 +46,8 @@ public class MockDispatchQueue: OSDispatchQueue {
4646
self.numDispatches += 1
4747
}
4848
}
49-
50-
public func waitForDispatches(_ numDispatches: Int) -> Void {
49+
50+
public func waitForDispatches(_ numDispatches: Int) {
5151
while self.numDispatches < numDispatches {
5252
requestDispatch.sync {
5353
Thread.sleep(forTimeInterval: TimeInterval(1))

iOS_SDK/OneSignalSDK/OneSignalCoreMocks/OneSignalCoreMocks.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ public class OneSignalCoreMocks: NSObject {
5151
let expectation = XCTestExpectation(description: "Wait for \(seconds) seconds")
5252
_ = XCTWaiter.wait(for: [expectation], timeout: seconds)
5353
}
54-
54+
5555
@objc public static func backgroundApp() {
56-
if (OSBundleUtils.isAppUsingUIScene()) {
56+
if OSBundleUtils.isAppUsingUIScene() {
5757
if #available(iOS 13.0, *) {
5858
NotificationCenter.default.post(name: UIScene.willDeactivateNotification, object: nil)
5959
NotificationCenter.default.post(name: UIScene.didEnterBackgroundNotification, object: nil)
@@ -63,9 +63,9 @@ public class OneSignalCoreMocks: NSObject {
6363
NotificationCenter.default.post(name: UIApplication.didEnterBackgroundNotification, object: nil)
6464
}
6565
}
66-
66+
6767
@objc public static func foregroundApp() {
68-
if (OSBundleUtils.isAppUsingUIScene()) {
68+
if OSBundleUtils.isAppUsingUIScene() {
6969
if #available(iOS 13.0, *) {
7070
NotificationCenter.default.post(name: UIScene.willEnterForegroundNotification, object: nil)
7171
NotificationCenter.default.post(name: UIScene.didActivateNotification, object: nil)
@@ -75,19 +75,19 @@ public class OneSignalCoreMocks: NSObject {
7575
NotificationCenter.default.post(name: UIApplication.didBecomeActiveNotification, object: nil)
7676
}
7777
}
78-
78+
7979
@objc public static func resignActive() {
80-
if (OSBundleUtils.isAppUsingUIScene()) {
80+
if OSBundleUtils.isAppUsingUIScene() {
8181
if #available(iOS 13.0, *) {
8282
NotificationCenter.default.post(name: UIScene.willDeactivateNotification, object: nil)
8383
}
8484
} else {
8585
NotificationCenter.default.post(name: UIApplication.willResignActiveNotification, object: nil)
8686
}
8787
}
88-
88+
8989
@objc public static func becomeActive() {
90-
if (OSBundleUtils.isAppUsingUIScene()) {
90+
if OSBundleUtils.isAppUsingUIScene() {
9191
if #available(iOS 13.0, *) {
9292
NotificationCenter.default.post(name: UIScene.didActivateNotification, object: nil)
9393
}

iOS_SDK/OneSignalSDK/OneSignalNotificationsTests/OneSignalNotificationsTests.swift

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import OneSignalCoreMocks
1212
import UIKit
1313

1414
final class OneSignalNotificationsTests: XCTestCase {
15-
15+
1616
var notifTypes: Int32 = 0
1717
var token: String = ""
1818

@@ -38,7 +38,7 @@ final class OneSignalNotificationsTests: XCTestCase {
3838
// Ensure that badge count == 0
3939
XCTAssertEqual(UIApplication.shared.applicationIconBadgeNumber, 0)
4040
}
41-
41+
4242
func testDontclearBadgesWhenAppBecomesActive() throws {
4343
// NotificationManager Start to register lifecycle listener
4444
OSNotificationsManager.start()
@@ -51,25 +51,24 @@ final class OneSignalNotificationsTests: XCTestCase {
5151
// Ensure that badge count == 0
5252
XCTAssertEqual(UIApplication.shared.applicationIconBadgeNumber, 1)
5353
}
54-
54+
5555
func testUpdateNotificationTypesOnAppEntersForeground() throws {
5656
// NotificationManager Start to register lifecycle listener
5757
OSNotificationsManager.start()
58-
58+
5959
OSNotificationsManager.delegate = self
60-
60+
6161
XCTAssertEqual(self.notifTypes, 0)
62-
62+
6363
// Then background the app
6464
OneSignalCoreMocks.backgroundApp()
65-
65+
6666
// Foreground the app for within 30 seconds
6767
OneSignalCoreMocks.foregroundApp()
68-
68+
6969
// Ensure that the delegate is updated with the new notification type
7070
XCTAssertEqual(self.notifTypes, ERROR_PUSH_NEVER_PROMPTED)
7171
}
72-
7372

7473
}
7574

0 commit comments

Comments
 (0)