Open hothsolo opened 11 months ago
We can share the code here and then know about the issues.
I figured it out. I just didn't add the extensions. I think it would be very helpful if that step was on the main page here.
Cj
So having a couple issues still. First, I'm trying to integrate this into my own code. So I don't have your ChatViewController. But the viewcontrollerextension requires it in the mqtt func inside there. Can I just eliminate that code? Second, this animal variable. Can you explain what that is used for?
Cj
Or maybe I can just use this instead of the delegate? I'm not sure I understand exactly what the delegate is doing.
Is there a closure for didConnectAck? If so, please, how do you use it?
Cj
Is there a closure for didConnectAck? If so, please, how do you use it?
Cj
Hello. There is the demo.
mqtt5 = CocoaMQTT5(clientID: clientID, host: defaultHost, port: 1883)
mqtt5!.didReceiveMessage = { mqtt, message, msgid
,publishRecProperties in print("Message received in topic \(message.topic) with payload \(message.string!)")
}
When I do the mqtt5.delegate = self, I get an error saying it cannot assign a value of type ViewController to this variable. THanks for any help.
Cj