Skip to content

Commit ef6b63c

Browse files
committed
Updated methods signature
1 parent c015012 commit ef6b63c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Diff for: Source/SocketIO/Client/SocketIOClient.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ open class SocketIOClient: NSObject, SocketIOClientSpec {
212212
/// - parameter items: The items to send with this event. May be left out.
213213
/// - parameter completion: Callback called on transport write completion.
214214
open func emit(_ event: String, _ items: SocketData..., completion: (() -> ())? = nil) {
215-
emit(event, items, completion: completion)
215+
emit(event, with: items, completion: completion)
216216
}
217217

218218
/// Send an event to the server, with optional data items and optional write completion handler.
@@ -223,7 +223,7 @@ open class SocketIOClient: NSObject, SocketIOClientSpec {
223223
/// - parameter event: The event to send.
224224
/// - parameter items: The items to send with this event. May be left out.
225225
/// - parameter completion: Callback called on transport write completion.
226-
open func emit(_ event: String, _ items: [SocketData], completion: (() -> ())?) {
226+
open func emit(_ event: String, with items: [SocketData], completion: (() -> ())?) {
227227

228228
do {
229229
emit([event] + (try items.map({ try $0.socketRepresentation() })), completion: completion)
@@ -255,7 +255,7 @@ open class SocketIOClient: NSObject, SocketIOClientSpec {
255255
/// - parameter items: The items to send with this event. May be left out.
256256
/// - returns: An `OnAckCallback`. You must call the `timingOut(after:)` method before the event will be sent.
257257
open func emitWithAck(_ event: String, _ items: SocketData...) -> OnAckCallback {
258-
emitWithAck(event, items)
258+
emitWithAck(event, with: items)
259259
}
260260

261261
/// Sends a message to the server, requesting an ack.
@@ -277,7 +277,7 @@ open class SocketIOClient: NSObject, SocketIOClientSpec {
277277
/// - parameter event: The event to send.
278278
/// - parameter items: The items to send with this event. May be left out.
279279
/// - returns: An `OnAckCallback`. You must call the `timingOut(after:)` method before the event will be sent.
280-
open func emitWithAck(_ event: String, _ items: [SocketData]) -> OnAckCallback {
280+
open func emitWithAck(_ event: String, with items: [SocketData]) -> OnAckCallback {
281281

282282
do {
283283
return createOnAck([event] + (try items.map({ try $0.socketRepresentation() })))

Diff for: Source/SocketIO/Client/SocketIOClientSpec.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public protocol SocketIOClientSpec : AnyObject {
116116
/// - parameter event: The event to send.
117117
/// - parameter items: The items to send with this event. May be left out.
118118
/// - parameter completion: Callback called on transport write completion.
119-
func emit(_ event: String, _ items: [SocketData], completion: (() -> ())?)
119+
func emit(_ event: String, with items: [SocketData], completion: (() -> ())?)
120120

121121
/// Call when you wish to tell the server that you've received the event for `ack`.
122122
///
@@ -164,7 +164,7 @@ public protocol SocketIOClientSpec : AnyObject {
164164
/// - parameter event: The event to send.
165165
/// - parameter items: The items to send with this event. May be left out.
166166
/// - returns: An `OnAckCallback`. You must call the `timingOut(after:)` method before the event will be sent.
167-
func emitWithAck(_ event: String, _ items: [SocketData]) -> OnAckCallback
167+
func emitWithAck(_ event: String, with items: [SocketData]) -> OnAckCallback
168168

169169
/// Called when socket.io has acked one of our emits. Causes the corresponding ack callback to be called.
170170
///

0 commit comments

Comments
 (0)