Back to Socket Io Client Swift

SocketEventHandler

docs/Structs/SocketEventHandler.html

16.1.11.3 KB
Original Source

SocketEventHandler

public struct SocketEventHandler

A wrapper around a handler.

Properties

`

                event
                `

The event for this handler.

Declaration

Swift

public let event: String

`

                id
                `

A unique identifier for this handler.

Declaration

Swift

public let id: UUID

`

                callback
                `

The actual handler function.

Declaration

Swift

public let callback: NormalCallback

Methods

`

                executeCallback(with:withAck:withSocket:)
                `

Causes this handler to be executed.

Declaration

Swift

public func executeCallback(with items: [Any], withAck ack: Int, withSocket socket: SocketIOClient)

Parameters

| with |

The data that this handler should be called with.

| | withAck |

The ack number that this event expects. Pass -1 to say this event doesn’t expect an ack.

| | withSocket |

The socket that is calling this event.

|