some swift3 changes
This commit is contained in:
parent
f6dc11650d
commit
f3d771641d
@ -124,11 +124,12 @@ public final class SocketIOClient : NSObject, SocketEngineClient, SocketParsable
|
|||||||
|
|
||||||
/// Connect to the server.
|
/// Connect to the server.
|
||||||
public func connect() {
|
public func connect() {
|
||||||
connect(0, handleWith: nil)
|
connect(timeoutAfter: 0, withHandler: nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Connect to the server. If we aren't connected after timeoutAfter, call handler
|
/// Connect to the server. If we aren't connected after timeoutAfter, call withHandler
|
||||||
public func connect(_ timeoutAfter: Int, handleWith handler: (() -> Void)?) {
|
/// 0 Never times out
|
||||||
|
public func connect(timeoutAfter: Int, withHandler handler: (() -> Void)?) {
|
||||||
assert(timeoutAfter >= 0, "Invalid timeout: \(timeoutAfter)")
|
assert(timeoutAfter >= 0, "Invalid timeout: \(timeoutAfter)")
|
||||||
|
|
||||||
guard status != .connected else {
|
guard status != .connected else {
|
||||||
@ -410,6 +411,7 @@ public final class SocketIOClient : NSObject, SocketEngineClient, SocketParsable
|
|||||||
handlers.removeAll(keepingCapacity: false)
|
handlers.removeAll(keepingCapacity: false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Because Swift 3 removes a lot of implicit briding so we have to perform more casts
|
||||||
func socketDataToAnyObject(_ data: [SocketData]) -> [AnyObject] {
|
func socketDataToAnyObject(_ data: [SocketData]) -> [AnyObject] {
|
||||||
return data.flatMap({$0 as? AnyObject})
|
return data.flatMap({$0 as? AnyObject})
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user