Classes
The following classes are available globally.
-
The class that handles the engine.io protocol and transports. See
See moreSocketEnginePollable
andSocketEngineWebsocket
for transport specific methods.Declaration
Swift
public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePollable, SocketEngineWebsocket
-
A class that represents a waiting ack call.
NOTE: You should not store this beyond the life of the event handler.
See moreDeclaration
Swift
public final class SocketAckEmitter : NSObject
-
A class that represents an emit that will request an ack that has not yet been sent. Call
timingOut(after:callback:)
to complete the emit Example:
See moresocket.emitWithAck("myEvent").timingOut(after: 1) {data in ... }
Declaration
Swift
public final class OnAckCallback : NSObject
-
Represents some event that was received.
See moreDeclaration
Swift
public final class SocketAnyEvent : NSObject
-
The main class for SocketIOClientSwift.
NOTE: The client is not thread/queue safe, all interaction with the socket should be done on the
handleQueue
Represents a socket.io-client. Most interaction with socket.io will be through this class.
See moreDeclaration
Swift
open class SocketIOClient : NSObject, SocketIOClientSpec, SocketEngineClient, SocketParsable
-
Experimental socket manager.
API subject to change.
Can be used to persist sockets across ViewControllers.
Sockets are strongly stored, so be sure to remove them once they are no longer needed.
Example usage:
See morelet manager = SocketClientManager.sharedManager manager["room1"] = socket1 manager["room2"] = socket2 manager.removeSocket(socket: socket2) manager["room1"]?.emit("hello")
Declaration
Swift
open class SocketClientManager : NSObject