             // setup new timer
             heartbeatTimer?.invalidate()
             heartbeatTimer = NSTimer.scheduledTimerWithTimeInterval(30,
-                target: self, selector: "sendHeartbeat", userInfo: nil, repeats: true)
+                target: self, selector: #selector(Socket.sendHeartbeat), userInfo: nil, repeats: true)
         } else {
             log("Connecting to", socket.currentURL)
             channels.forEach { $0.status = .Joining }

            // let's invalidate old timer if any
            reconnectTimer?.invalidate()
            reconnectTimer = NSTimer.scheduledTimerWithTimeInterval(reconnectInterval,
                target: self, selector: "retry", userInfo: nil, repeats: true)
        }
        
        if socket.isConnected { // just restart heartbeat timer

        onConnect?()
        heartbeatTimer?.invalidate()
        heartbeatTimer = NSTimer.scheduledTimerWithTimeInterval(30,
            target: self, selector: #selector(Socket.sendHeartbeat), userInfo: nil, repeats: true)
        // statuses set when we were connecting socket
        channels.forEach(sendJoinEvent)
    }
