Skip to content

Commit 082eb0c

Browse files
committed
refactor: delete CocoaMQTTDelegate func mqtt(_ mqtt: CocoaMQTT, didConnect host: String, port: Int)
1 parent 6a528d0 commit 082eb0c

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

Example/Example.xcodeproj/project.pbxproj

+3-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@
160160
TargetAttributes = {
161161
04DB76531C1E7BB900776B4C = {
162162
CreatedOnToolsVersion = 7.1.1;
163-
DevelopmentTeam = 43Z4G3YJ6R;
163+
DevelopmentTeam = 2Z2KAMMN28;
164164
LastSwiftMigration = 0800;
165165
};
166166
};
@@ -375,6 +375,7 @@
375375
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
376376
CODE_SIGN_IDENTITY = "iPhone Developer";
377377
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
378+
DEVELOPMENT_TEAM = 2Z2KAMMN28;
378379
INFOPLIST_FILE = Example/Info.plist;
379380
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
380381
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@@ -393,6 +394,7 @@
393394
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
394395
CODE_SIGN_IDENTITY = "iPhone Developer";
395396
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
397+
DEVELOPMENT_TEAM = 2Z2KAMMN28;
396398
INFOPLIST_FILE = Example/Info.plist;
397399
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
398400
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";

Example/Example/ViewController.swift

-4
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,6 @@ class ViewController: UIViewController {
121121
}
122122

123123
extension ViewController: CocoaMQTTDelegate {
124-
func mqtt(_ mqtt: CocoaMQTT, didConnect host: String, port: Int) {
125-
print("didConnect \(host):\(port)")
126-
}
127-
128124
// Optional ssl CocoaMQTTDelegate
129125
func mqtt(_ mqtt: CocoaMQTT, didReceive trust: SecTrust, completionHandler: @escaping (Bool) -> Void) {
130126
/// Validate the server certificate

Source/CocoaMQTT.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ fileprivate enum CocoaMQTTReadTag: Int {
5757
*/
5858
@objc public protocol CocoaMQTTDelegate {
5959
/// MQTT connected with server
60-
func mqtt(_ mqtt: CocoaMQTT, didConnect host: String, port: Int)
60+
// deprecated: use mqtt(_ mqtt: CocoaMQTT, didConnectAck ack: CocoaMQTTConnAck) to tell if connect to the server successfully
61+
// func mqtt(_ mqtt: CocoaMQTT, didConnect host: String, port: Int)
6162
func mqtt(_ mqtt: CocoaMQTT, didConnectAck ack: CocoaMQTTConnAck)
6263
func mqtt(_ mqtt: CocoaMQTT, didPublishMessage message: CocoaMQTTMessage, id: UInt16)
6364
func mqtt(_ mqtt: CocoaMQTT, didPublishAck id: UInt16)
@@ -214,7 +215,6 @@ open class CocoaMQTT: NSObject, CocoaMQTTClient, CocoaMQTTFrameBufferProtocol {
214215
let frame = CocoaMQTTFrameConnect(client: self)
215216
send(frame)
216217
reader!.start()
217-
delegate?.mqtt(self, didConnect: host, port: Int(port))
218218
}
219219

220220
fileprivate func nextMessageID() -> UInt16 {

0 commit comments

Comments
 (0)