From 933ac84d965157ac4f7d43af20b6241fd5d01ffe Mon Sep 17 00:00:00 2001 From: Roman Baitaliuk Date: Sun, 14 Oct 2018 15:58:44 +1300 Subject: [PATCH] Added Swift 4.2 support --- .swift-version | 2 +- ClusterWS-Client-Swift.podspec | 2 +- Sources/WebSocket.swift | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.swift-version b/.swift-version index 5186d07..bf77d54 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -4.0 +4.2 diff --git a/ClusterWS-Client-Swift.podspec b/ClusterWS-Client-Swift.podspec index 0aad554..ebb9ee6 100644 --- a/ClusterWS-Client-Swift.podspec +++ b/ClusterWS-Client-Swift.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'ClusterWS-Client-Swift' - s.version = '3.0.2' + s.version = '3.1.0' s.summary = 'Swift Client for ClusterWS' s.description = 'Swift Client for ClusterWS - lightweight, fast and powerful framework for building horizontally & vertically scalable WebSocket applications in Node.js' s.homepage = 'https://github.com/ClusterWS/ClusterWS-Client-Swift' diff --git a/Sources/WebSocket.swift b/Sources/WebSocket.swift index 1635852..fcc8f9f 100644 --- a/Sources/WebSocket.swift +++ b/Sources/WebSocket.swift @@ -967,8 +967,8 @@ private class InnerWebSocket: Hashable { } func closeConn() { - rd.remove(from: RunLoop.main, forMode: RunLoopMode.defaultRunLoopMode) - wr.remove(from: RunLoop.main, forMode: RunLoopMode.defaultRunLoopMode) + rd.remove(from: RunLoop.main, forMode: RunLoop.Mode.default) + wr.remove(from: RunLoop.main, forMode: RunLoop.Mode.default) rd.delegate = nil wr.delegate = nil rd.close() @@ -1087,8 +1087,8 @@ private class InnerWebSocket: Hashable { } rd.delegate = delegate wr.delegate = delegate - rd.schedule(in: RunLoop.main, forMode: RunLoopMode.defaultRunLoopMode) - wr.schedule(in: RunLoop.main, forMode: RunLoopMode.defaultRunLoopMode) + rd.schedule(in: RunLoop.main, forMode: RunLoop.Mode.default) + wr.schedule(in: RunLoop.main, forMode: RunLoop.Mode.default) rd.open() wr.open() try write(header, length: header.count) @@ -1650,7 +1650,7 @@ open class WebSocket: NSObject { fileprivate var ws: InnerWebSocket fileprivate var id = manager.nextId() fileprivate var opened: Bool - open override var hashValue: Int { return id } + open override var hash: Int { return id } /// Create a WebSocket connection to a URL; this should be the URL to which the WebSocket server will respond. public convenience init(_ url: String){ self.init(request: URLRequest(url: URL(string: url)!), subProtocols: [])