update readme with new methods
This commit is contained in:
parent
711ce8d8c4
commit
8c02f5ef7b
10
README.md
10
README.md
@ -19,10 +19,12 @@ Methods
|
|||||||
1. `socket.on(name:String, callback:((data:NSArray?, ack:AckEmitter?) -> Void))` - Adds a handler for an event. Items are passed by an array. `ack` can be used to send an ack when one is requested. See example.
|
1. `socket.on(name:String, callback:((data:NSArray?, ack:AckEmitter?) -> Void))` - Adds a handler for an event. Items are passed by an array. `ack` can be used to send an ack when one is requested. See example.
|
||||||
2. `socket.onAny(callback:((event:String, items:AnyObject?)) -> Void)` - Adds a handler for all events. It will be called on any received event.
|
2. `socket.onAny(callback:((event:String, items:AnyObject?)) -> Void)` - Adds a handler for all events. It will be called on any received event.
|
||||||
3. `socket.emit(event:String, args:AnyObject...)` - Sends a message. Can send multiple args.
|
3. `socket.emit(event:String, args:AnyObject...)` - Sends a message. Can send multiple args.
|
||||||
4. `socket.emitWithAck(event:String, args:AnyObject...) -> SocketAckHandler` - Sends a message that requests an acknowledgement from the server. Returns a SocketAckHandler which you can use to add an onAck handler. See example.
|
4. `socket.emitObjc(event:String, args:[AnyObject])` - `emit` for Objective-C
|
||||||
5. `socket.connect()` - Establishes a connection to the server. A "connect" event is fired upon successful connection.
|
5. `socket.emitWithAck(event:String, args:AnyObject...) -> SocketAckHandler` - Sends a message that requests an acknowledgement from the server. Returns a SocketAckHandler which you can use to add an onAck handler. See example.
|
||||||
6. `socket.connectWithParams(params:[String: AnyObject])` - Establishes a connection to the server passing the specified params. A "connect" event is fired upon successful connection.
|
6. `socket.emitWithAckObjc(event:String, _ args:[AnyObject]) -> SocketAckHandler` - `emitWithAck` for Objective-C.
|
||||||
7. `socket.close()` - Closes the socket. Once a socket is closed it should not be reopened.
|
7. `socket.connect()` - Establishes a connection to the server. A "connect" event is fired upon successful connection.
|
||||||
|
8. `socket.connectWithParams(params:[String: AnyObject])` - Establishes a connection to the server passing the specified params. A "connect" event is fired upon successful connection.
|
||||||
|
9. `socket.close()` - Closes the socket. Once a socket is closed it should not be reopened.
|
||||||
|
|
||||||
Events
|
Events
|
||||||
------
|
------
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user