Skip to content

Commit 7b11e7c

Browse files
committed
documentation
1 parent 6e5b95b commit 7b11e7c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ case Secure(Bool) // If the connection should use TLS. Default is false.
150150
```
151151
Methods
152152
-------
153-
1. `on(event: String, callback: NormalCallback)` - 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.
154-
2. `once(event: String, callback: NormalCallback)` - Adds a handler that will only be executed once.
153+
1. `on(event: String, callback: NormalCallback) -> NSUUID` - 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. Returns a unique id for the handler.
154+
2. `once(event: String, callback: NormalCallback) -> NSUUID` - Adds a handler that will only be executed once. Returns a unique id for the handler.
155155
3. `onAny(callback:((event: String, items: AnyObject?)) -> Void)` - Adds a handler for all events. It will be called on any received event.
156156
4. `emit(event: String, _ items: AnyObject...)` - Sends a message. Can send multiple items.
157157
5. `emit(event: String, withItems items: [AnyObject])` - `emit` for Objective-C
@@ -164,7 +164,8 @@ Methods
164164
12. `joinNamespace()` - Causes the client to join nsp. Shouldn't need to be called unless you change nsp manually.
165165
13. `leaveNamespace()` - Causes the client to leave the nsp and go back to /
166166
14. `off(event: String)` - Removes all event handlers for event.
167-
15. `removeAllHandlers()` - Removes all handlers.
167+
15. `off(id id: NSUUID)` - Removes the event that corresponds to id.
168+
16. `removeAllHandlers()` - Removes all handlers.
168169

169170
Client Events
170171
------

Source/SocketIOClient.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ public final class SocketIOClient: NSObject, SocketEngineClient {
400400

401401
/**
402402
Adds a handler for an event.
403+
Returns: A unique id for the handler
403404
*/
404405
public func on(event: String, callback: NormalCallback) -> NSUUID {
405406
DefaultSocketLogger.Logger.log("Adding handler for event: %@", type: logType, args: event)
@@ -412,6 +413,7 @@ public final class SocketIOClient: NSObject, SocketEngineClient {
412413

413414
/**
414415
Adds a single-use handler for an event.
416+
Returns: A unique id for the handler
415417
*/
416418
public func once(event: String, callback: NormalCallback) -> NSUUID {
417419
DefaultSocketLogger.Logger.log("Adding once handler for event: %@", type: logType, args: event)

0 commit comments

Comments
 (0)