From 26f3ccdce9d10488ff15048345410a3f46bf535c Mon Sep 17 00:00:00 2001 From: Felipe Benevides Date: Fri, 19 May 2023 12:04:14 +0200 Subject: [PATCH 1/2] Revert "Fix `Run SwiftLint autocorrect` build phase not working (#404)" This reverts commit 29c977ad572310a0a63f77392bb7c335abf81fbf. --- PusherSwift.xcodeproj/project.pbxproj | 2 +- Sources/Models/PusherChannel.swift | 8 ++++---- Sources/PusherSwift.swift | 2 +- Sources/Services/PusherConnection.swift | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/PusherSwift.xcodeproj/project.pbxproj b/PusherSwift.xcodeproj/project.pbxproj index 100d8bf8..f249a9b0 100644 --- a/PusherSwift.xcodeproj/project.pbxproj +++ b/PusherSwift.xcodeproj/project.pbxproj @@ -560,7 +560,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "if which swiftlint >/dev/null; then\n swiftlint --fix\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n"; + shellScript = "if which swiftlint >/dev/null; then\n swiftlint autocorrect\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n"; }; /* End PBXShellScriptBuildPhase section */ diff --git a/Sources/Models/PusherChannel.swift b/Sources/Models/PusherChannel.swift index e1b43314..94f124cf 100644 --- a/Sources/Models/PusherChannel.swift +++ b/Sources/Models/PusherChannel.swift @@ -15,12 +15,12 @@ open class PusherChannel: NSObject { eventHandlersQueue.async(flags: .barrier) { self.eventHandlersInternal = newValue } } } - - private var _subscriptionCount: Int? + + private var _subscriptionCount: Int? = nil public var subscriptionCount: Int? { get { return _subscriptionCount } } - + open var subscribed = false public let name: String open weak var connection: PusherConnection? @@ -59,7 +59,7 @@ open class PusherChannel: NSObject { self.type = PusherChannelType(name: name) self.onSubscriptionCountChanged = onSubscriptionCountChanged } - + internal func updateSubscriptionCount(count: Int) { self._subscriptionCount = count self.onSubscriptionCountChanged?(count) diff --git a/Sources/PusherSwift.swift b/Sources/PusherSwift.swift index 519ee3e1..c980eada 100644 --- a/Sources/PusherSwift.swift +++ b/Sources/PusherSwift.swift @@ -9,7 +9,7 @@ let CLIENT_NAME = "pusher-websocket-swift" @objcMembers @objc open class Pusher: NSObject { public let connection: PusherConnection - open weak var delegate: PusherDelegate? { + open weak var delegate: PusherDelegate? = nil { willSet { self.connection.delegate = newValue } diff --git a/Sources/Services/PusherConnection.swift b/Sources/Services/PusherConnection.swift index 16c55cb3..87325c2b 100644 --- a/Sources/Services/PusherConnection.swift +++ b/Sources/Services/PusherConnection.swift @@ -18,7 +18,7 @@ import NWWebSocket open var reconnectAttemptsMax: Int? open var reconnectAttempts: Int = 0 open var maxReconnectGapInSeconds: Double? = 120 - open weak var delegate: PusherDelegate? { + open weak var delegate: PusherDelegate? = nil { // Set the delegate for logging purposes via `debugLog(message:)` didSet { Logger.shared.delegate = self.delegate From 7a64aa9d4c8ada18cc1f3d3e116500c9e7eca505 Mon Sep 17 00:00:00 2001 From: fbenevides Date: Fri, 19 May 2023 12:17:19 +0200 Subject: [PATCH 2/2] Fix autocorrect --- PusherSwift.xcodeproj/project.pbxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PusherSwift.xcodeproj/project.pbxproj b/PusherSwift.xcodeproj/project.pbxproj index f249a9b0..39cd15bf 100644 --- a/PusherSwift.xcodeproj/project.pbxproj +++ b/PusherSwift.xcodeproj/project.pbxproj @@ -560,7 +560,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "if which swiftlint >/dev/null; then\n swiftlint autocorrect\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n"; + shellScript = "if which swiftlint >/dev/null; then\n swiftlint --fix\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n"; }; /* End PBXShellScriptBuildPhase section */