I have a custom ViewController delegate class, which handles ui actions such as button clicked and display text in a text view.
Now I want to use AsyncSocket in the class. I have been able to create a socket object
var tcpSocket = GCDAsyncSocket(delegate: self, delegateQueue: dispatch_get_main_queue())
Now I want to implement those callback functions, such as didConnectToHosts(...) whose declaration is provided in GCDAsyncSocket.h:
- (void)socket:(GCDAsyncSocket *)sock didConnectToHost:(NSString *)host port:(uint16_t)port;
How do I implement this function in my swift class?