diff --git a/PusherSwift.xcodeproj/project.pbxproj b/PusherSwift.xcodeproj/project.pbxproj index f249a9b0..100d8bf8 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 */ diff --git a/Sources/Models/PusherChannel.swift b/Sources/Models/PusherChannel.swift index 94f124cf..e1b43314 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? = nil + + private var _subscriptionCount: Int? 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 c980eada..519ee3e1 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? = nil { + open weak var delegate: PusherDelegate? { willSet { self.connection.delegate = newValue } diff --git a/Sources/Services/PusherConnection.swift b/Sources/Services/PusherConnection.swift index 87325c2b..16c55cb3 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? = nil { + open weak var delegate: PusherDelegate? { // Set the delegate for logging purposes via `debugLog(message:)` didSet { Logger.shared.delegate = self.delegate