     public let retain: Bool
 
     public var payloadString: String? {
-        return NSString(data: payload, encoding: NSUTF8StringEncoding)
+        return NSString(data: payload, encoding: NSUTF8StringEncoding) as? String
     }
 
     internal init(messageId: Int, topic: String, payload: NSData, qos: Int32, retain: Bool) {


    public func publishString(payload: String, topic: String, qos: Int32, retain: Bool, requestCompletion: ((MosqResult, Int) -> ())? = nil) {
        if let payloadData = (payload as NSString).dataUsingEncoding(NSUTF8StringEncoding) {
            publish(payloadData, topic: topic, qos: qos, retain: retain, requestCompletion)
        }
    }



@objc(__MosquittoContext)
public final class __MosquittoContext {
    public var mosquittoHandler: COpaquePointer = nil
    public var isConnected: Bool = false
    public var onConnectCallback: ((returnCode: Int) -> ())!
    public var onDisconnectCallback: ((reasonCode: Int) -> ())!
