mobile-web-messaging / MQTTKit

MQTT Objective-C client for iOS
Apache License 2.0
462 stars 226 forks source link

Not able to Set Message Handler #26

Closed thewodros closed 9 years ago

thewodros commented 9 years ago

Hi, I am trying to use the MQTTKit framework in my Swift project. I was able to connect to my server and subscribe to a topic using the: "connectToHost:(NSString)host completionHandler:" and "subscribe(NSString )topic withCompletionHandler:" methods respectively; however, I was not able to set a message handler as explained in the github doc here: https://github.com/jmesnil/MQTTKit#subscribe-to-a-topic-and-receive-messages.

Basically I don't see the "setMessageHandler:" method in the library.

Thanks, Teddy

jmesnil commented 9 years ago

The messageHandler is a property of the MQTTClient class: https://github.com/mobile-web-messaging/MQTTKit/blob/master/MQTTKit/MQTTKit.h#L61