Skip to content

Commit 8f94c03

Browse files
committed
Fix build
1 parent a4b334b commit 8f94c03

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

Source/SocketIO/Client/SocketIOClient.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ open class SocketIOClient : NSObject, SocketIOClientSpec {
230230
/// - parameter event: The event to send.
231231
/// - parameter items: The items to send with this event. May be left out.
232232
/// - parameter completion: Callback called on transport write completion.
233-
open func emit(_ event: String, _ items: SocketData..., completion: @escaping (() -> ())? = nil) {
233+
open func emit(_ event: String, _ items: SocketData..., completion: (() -> ())? = nil) {
234234
do {
235235
try emit(event, with: items.map({ try $0.socketRepresentation() }), completion: completion)
236236
} catch {
@@ -256,7 +256,7 @@ open class SocketIOClient : NSObject, SocketIOClientSpec {
256256
/// - parameter items: The items to send with this event. Send an empty array to send no data.
257257
/// - parameter completion: Callback called on transport write completion.
258258
@objc
259-
open func emit(_ event: String, with items: [Any], completion: @escaping (() -> ())? = nil) {
259+
open func emit(_ event: String, with items: [Any], completion: (() -> ())? = nil) {
260260
emit([event] + items, completion: completion)
261261
}
262262

@@ -317,13 +317,13 @@ open class SocketIOClient : NSObject, SocketIOClientSpec {
317317
ack: Int? = nil,
318318
binary: Bool = true,
319319
isAck: Bool = false,
320-
completion: @escaping (() -> ())? = nil
320+
completion: (() -> ())? = nil
321321
) {
322322
// wrap the completion handler so it always runs async via handlerQueue
323323
let wrappedCompletion: (() -> ())? = (completion == nil) ? nil : {[weak self] in
324324
guard let this = self else { return }
325325
this.manager?.handleQueue.async {
326-
completion()
326+
completion!()
327327
}
328328
}
329329

Source/SocketIO/Client/SocketIOClientSpec.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public protocol SocketIOClientSpec : AnyObject {
109109
/// - parameter event: The event to send.
110110
/// - parameter items: The items to send with this event. May be left out.
111111
/// - parameter completion: Callback called on transport write completion.
112-
func emit(_ event: String, _ items: SocketData..., completion: @escaping (() -> ())? = nil)
112+
func emit(_ event: String, _ items: SocketData..., completion: (() -> ())?)
113113

114114
/// Call when you wish to tell the server that you've received the event for `ack`.
115115
///

Source/SocketIO/Engine/SocketEngine.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ open class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePollable, So
617617
/// - parameter type: The type of this message.
618618
/// - parameter data: Any data that this message has.
619619
/// - parameter completion: Callback called on transport write completion.
620-
open func write(_ msg: String, withType type: SocketEnginePacketType, withData data: [Data], completion: @escaping (() -> ())? = nil) {
620+
open func write(_ msg: String, withType type: SocketEnginePacketType, withData data: [Data], completion: (() -> ())? = nil) {
621621
engineQueue.async {
622622
guard self.connected else {
623623
completion?()

Source/SocketIO/Engine/SocketEnginePollable.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public protocol SocketEnginePollable : SocketEngineSpec {
6565
/// - parameter message: The message to send.
6666
/// - parameter withType: The type of message to send.
6767
/// - parameter withData: The data associated with this message.
68-
func sendPollMessage(_ message: String, withType type: SocketEnginePacketType, withData datas: [Data], completion: @escaping (() -> ())?)
68+
func sendPollMessage(_ message: String, withType type: SocketEnginePacketType, withData datas: [Data], completion: (() -> ())?)
6969

7070
/// Call to stop polling and invalidate the URLSession.
7171
func stopPolling()
@@ -219,7 +219,7 @@ extension SocketEnginePollable {
219219
/// - parameter withType: The type of message to send.
220220
/// - parameter withData: The data associated with this message.
221221
/// - parameter completion: Callback called on transport write completion.
222-
public func sendPollMessage(_ message: String, withType type: SocketEnginePacketType, withData datas: [Data], completion: @escaping (() -> ())? = nil) {
222+
public func sendPollMessage(_ message: String, withType type: SocketEnginePacketType, withData datas: [Data], completion: (() -> ())? = nil) {
223223
DefaultSocketLogger.Logger.log("Sending poll: \(message) as type: \(type.rawValue)", type: "SocketEnginePolling")
224224

225225
postWait.append((String(type.rawValue) + message, completion))

Source/SocketIO/Engine/SocketEngineSpec.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ import Starscream
138138
/// - parameter type: The type of this message.
139139
/// - parameter data: Any data that this message has.
140140
/// - parameter completion: Callback called on transport write completion.
141-
func write(_ msg: String, withType type: SocketEnginePacketType, withData data: [Data], completion: @escaping (() -> ())?)
141+
func write(_ msg: String, withType type: SocketEnginePacketType, withData data: [Data], completion: (() -> ())?)
142142
}
143143

144144
extension SocketEngineSpec {
@@ -180,7 +180,7 @@ extension SocketEngineSpec {
180180
}
181181

182182
/// Send an engine message (4)
183-
func send(_ msg: String, withData datas: [Data], completion: @escaping (() -> ())? = nil) {
183+
func send(_ msg: String, withData datas: [Data], completion: (() -> ())? = nil) {
184184
write(msg, withType: .message, withData: datas, completion: completion)
185185
}
186186
}

Source/SocketIO/Engine/SocketEngineWebsocket.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public protocol SocketEngineWebsocket : SocketEngineSpec {
4141
func sendWebSocketMessage(_ str: String,
4242
withType type: SocketEnginePacketType,
4343
withData datas: [Data],
44-
completion: @escaping (() -> ())?)
44+
completion: (() -> ())?)
4545
}
4646

4747
// WebSocket methods
@@ -63,7 +63,7 @@ extension SocketEngineWebsocket {
6363
public func sendWebSocketMessage(_ str: String,
6464
withType type: SocketEnginePacketType,
6565
withData datas: [Data],
66-
completion: @escaping (() -> ())?
66+
completion: (() -> ())?
6767
) {
6868
DefaultSocketLogger.Logger.log("Sending ws: \(str) as type: \(type.rawValue)", type: "SocketEngineWebSocket")
6969

Tests/TestSocketIO/SocketMangerTest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public class TestSocket : SocketIOClient {
198198
super.didDisconnect(reason: reason)
199199
}
200200

201-
public override func emit(_ event: String, with items: [Any], completion: @escaping (() -> ())?) {
201+
public override func emit(_ event: String, with items: [Any], completion: (() -> ())?) {
202202
expectations[ManagerExpectation.emitAllEventCalled]?.fulfill()
203203
expectations[ManagerExpectation.emitAllEventCalled] = nil
204204

Tests/TestSocketIO/SocketSideEffectTest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,5 +511,5 @@ class TestEngine : SocketEngineSpec {
511511
func flushWaitingForPostToWebSocket() { }
512512
func parseEngineData(_ data: Data) { }
513513
func parseEngineMessage(_ message: String) { }
514-
func write(_ msg: String, withType type: SocketEnginePacketType, withData data: [Data], completion: @escaping (() -> ())?) { }
514+
func write(_ msg: String, withType type: SocketEnginePacketType, withData data: [Data], completion: (() -> ())?) { }
515515
}

0 commit comments

Comments
 (0)