diff --git a/README.md b/README.md index ccf3a80..96d67a6 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ socket.on("currentAmount") {data, ack in socket.emit("update", ["amount": cur + 2.50]) } - ack?(["Got your currentAmount", "dude"]) + ack?("Got your currentAmount", "dude") } } diff --git a/SocketIOClientSwift/SocketAnyEvent.swift b/SocketIOClientSwift/SocketAnyEvent.swift index 6d7228c..9926bc5 100644 --- a/SocketIOClientSwift/SocketAnyEvent.swift +++ b/SocketIOClientSwift/SocketAnyEvent.swift @@ -24,7 +24,7 @@ import Foundation -@objc public final class SocketAnyEvent { +public final class SocketAnyEvent: NSObject { public let event:String! public let items:NSArray? diff --git a/SocketIOClientSwift/SocketEngine.swift b/SocketIOClientSwift/SocketEngine.swift index f20bfc2..6fa37b8 100644 --- a/SocketIOClientSwift/SocketEngine.swift +++ b/SocketIOClientSwift/SocketEngine.swift @@ -284,7 +284,7 @@ public final class SocketEngine: NSObject, WebSocketDelegate, SocketLogClient { } else if !this.closed && this.polling { this.doPoll() } - }}?.resume() + }}.resume() } private func flushProbeWait() { @@ -361,7 +361,7 @@ public final class SocketEngine: NSObject, WebSocketDelegate, SocketLogClient { this?.doPoll() } } - }}?.resume() + }}.resume() } // We had packets waiting for send when we upgraded diff --git a/SocketIOClientSwift/SocketEngineClient.swift b/SocketIOClientSwift/SocketEngineClient.swift index 27040fb..3824722 100644 --- a/SocketIOClientSwift/SocketEngineClient.swift +++ b/SocketIOClientSwift/SocketEngineClient.swift @@ -26,7 +26,7 @@ import Foundation @objc public protocol SocketEngineClient { - var handleQueue:dispatch_queue_attr_t! {get} + var handleQueue:dispatch_queue_t! {get} var socketURL:String {get} var secure:Bool {get} diff --git a/SocketIOClientSwift/SocketEventHandler.swift b/SocketIOClientSwift/SocketEventHandler.swift index 68c5eb9..7b2d92b 100644 --- a/SocketIOClientSwift/SocketEventHandler.swift +++ b/SocketIOClientSwift/SocketEventHandler.swift @@ -25,7 +25,7 @@ import Foundation private func emitAckCallback(socket:SocketIOClient?, num:Int?) - (items:[AnyObject]) -> Void { + (items:AnyObject...) -> Void { socket?.emitAck(num ?? -1, withData: items) } diff --git a/SocketIOClientSwift/SocketTypes.swift b/SocketIOClientSwift/SocketTypes.swift index 306a7c9..596a267 100644 --- a/SocketIOClientSwift/SocketTypes.swift +++ b/SocketIOClientSwift/SocketTypes.swift @@ -25,6 +25,6 @@ import Foundation public typealias AckCallback = (NSArray?) -> Void -public typealias AckEmitter = ([AnyObject]) -> Void +public typealias AckEmitter = (AnyObject...) -> Void public typealias NormalCallback = (NSArray?, AckEmitter?) -> Void public typealias OnAckCallback = (timeout:UInt64, callback:AckCallback) -> Void