You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ socket.on("connect") {data, ack in
11
11
12
12
socket.on("currentAmount") {data, ack in
13
13
iflet cur = data?[0] as?Double {
14
-
socket.emitWithAck("canUpdate", cur)(timeout: 0) {data in
14
+
socket.emitWithAck("canUpdate", cur)(timeoutAfter: 0) {data in
15
15
socket.emit("update", ["amount": cur +2.50])
16
16
}
17
17
@@ -128,7 +128,7 @@ Methods
128
128
2.`onAny(callback:((event:String, items:AnyObject?)) -> Void)` - Adds a handler for all events. It will be called on any received event.
129
129
3.`emit(event:String, _ items:AnyObject...)` - Sends a message. Can send multiple items.
130
130
4.`emit(event:String, withItems items:[AnyObject])` - `emit` for Objective-C
131
-
5.`emitWithAck(event:String, _ items:AnyObject...) -> (timeout:UInt64, callback:(NSArray?) -> Void) -> Void` - Sends a message that requests an acknowledgement from the server. Returns a function which you can use to add a handler. See example. Note: The message is not sent until you call the returned function.
131
+
5.`emitWithAck(event:String, _ items:AnyObject...) -> (timeoutAfter:UInt64, callback:(NSArray?) -> Void) -> Void` - Sends a message that requests an acknowledgement from the server. Returns a function which you can use to add a handler. See example. Note: The message is not sent until you call the returned function.
132
132
6.`emitWithAck(event:String, withItems items:[AnyObject]) -> (UInt64, (NSArray?) -> Void) -> Void` - `emitWithAck` for Objective-C. Note: The message is not sent until you call the returned function.
133
133
7.`connect()` - Establishes a connection to the server. A "connect" event is fired upon successful connection.
134
134
8.`connect(#timeoutAfter:Int, withTimeoutHandler handler:(() -> Void)?)` - Connect to the server. If it isn't connected after timeoutAfter seconds, the handler is called.
0 commit comments