Skip to content

Commit

Permalink
Add closure parameter to didReceiveTrust (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
MindaugasJucius authored and HJianBo committed Jun 19, 2019
1 parent 520a29a commit 244c7e4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/CocoaMQTT.swift
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public class CocoaMQTT: NSObject, CocoaMQTTClient, CocoaMQTTDeliverProtocol {
fileprivate var socket = GCDAsyncSocket()
fileprivate var reader: CocoaMQTTReader?

// Clousures
// Closures
public var didConnectAck: (CocoaMQTT, CocoaMQTTConnAck) -> Void = { _, _ in }
public var didPublishMessage: (CocoaMQTT, CocoaMQTTMessage, UInt16) -> Void = { _, _, _ in }
public var didPublishAck: (CocoaMQTT, UInt16) -> Void = { _, _ in }
Expand All @@ -255,7 +255,7 @@ public class CocoaMQTT: NSObject, CocoaMQTTClient, CocoaMQTTDeliverProtocol {
public var didPing: (CocoaMQTT) -> Void = { _ in }
public var didReceivePong: (CocoaMQTT) -> Void = { _ in }
public var didDisconnect: (CocoaMQTT, Error?) -> Void = { _, _ in }
public var didReceiveTrust: (CocoaMQTT, SecTrust) -> Void = { _, _ in }
public var didReceiveTrust: (CocoaMQTT, SecTrust, @escaping (Bool) -> Swift.Void) -> Void = { _, _, _ in }
public var didCompletePublish: (CocoaMQTT, UInt16) -> Void = { _, _ in }
public var didChangeState: (CocoaMQTT, CocoaMQTTConnState) -> Void = { _, _ in }

Expand Down Expand Up @@ -448,7 +448,7 @@ extension CocoaMQTT: GCDAsyncSocketDelegate {
printDebug("didReceiveTrust")

delegate?.mqtt?(self, didReceive: trust, completionHandler: completionHandler)
didReceiveTrust(self, trust)
didReceiveTrust(self, trust, completionHandler)
}

public func socketDidSecure(_ sock: GCDAsyncSocket) {
Expand Down

0 comments on commit 244c7e4

Please sign in to comment.