From beaa4b695c6c514ab169a132b3c392b1383d6b97 Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 4 Jul 2017 08:46:07 -0400 Subject: [PATCH] document connect data item --- Source/SocketIOClientSpec.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Source/SocketIOClientSpec.swift b/Source/SocketIOClientSpec.swift index eaf63af..d707fbf 100644 --- a/Source/SocketIOClientSpec.swift +++ b/Source/SocketIOClientSpec.swift @@ -48,7 +48,15 @@ extension SocketIOClientSpec { /// The set of events that are generated by the client. public enum SocketClientEvent : String { - /// Emitted when the client connects. This is also called on a successful reconnection. + /// Emitted when the client connects. This is also called on a successful reconnection. A connect event gets one + /// data item: the namespace that was connected to. + /// + /// ```swift + /// socket.on(clientEvent: .connect) {data, ack in + /// guard let nsp = data[0] as? String else { return } + /// // Some logic using the nsp + /// } + /// ``` case connect /// Called when the socket has disconnected and will not attempt to try to reconnect.