Merge branch 'master' of https://github.com/nuclearace/Socket.IO-Client-Swift
This commit is contained in:
commit
dc0c6e9f48
@ -11,6 +11,14 @@ Installation
|
||||
|
||||
Use
|
||||
===
|
||||
Methods
|
||||
-------
|
||||
1. `socket.on(name:String, callback:((data:AnyObject?) -> Void))` - Adds a handler for an event.
|
||||
2. `socket.onMultipleArgs(name:String, callback:((data:[AnyObject]) -> Void))` - Adds a handler for an event that can have multiple items. Items are stored in an array.
|
||||
3. `socket.emit(event:String, args:AnyObject? = nil)` - Sends an event with optional arg.
|
||||
4. `socket.emitMultiple(event:String, args:AnyObject...)` - Sends an event with multiple args.
|
||||
5. `socket.connect()` - Establishes a connection to the server. A "connect" event is fired upon successful connection.
|
||||
6. `socket.close()` - Closes the socket. Once a socket is closed it should not be reopened.
|
||||
|
||||
```swift
|
||||
// opts can be omitted, will use default values
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user