From ea0fc9933e08940a82cb40c95e6bc98d7aa644a8 Mon Sep 17 00:00:00 2001 From: Erik Date: Sun, 12 Jul 2015 16:26:02 -0400 Subject: [PATCH 1/4] bump version --- README.md | 4 ++-- Socket.IO-Client-Swift.podspec | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index eec2c87..272c56d 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Carthage ----------------- Add this line to your `Cartfile`: ``` -github "socketio/socket.io-client-swift" ~> 2.3.7 # Or latest version +github "socketio/socket.io-client-swift" ~> 2.3.8 # Or latest version ``` Run `carthage update`. @@ -79,7 +79,7 @@ source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' use_frameworks! -pod 'Socket.IO-Client-Swift', '~> 2.3.7' # Or latest version +pod 'Socket.IO-Client-Swift', '~> 2.3.8' # Or latest version ``` Install pods: diff --git a/Socket.IO-Client-Swift.podspec b/Socket.IO-Client-Swift.podspec index 1848cb9..cbc2606 100644 --- a/Socket.IO-Client-Swift.podspec +++ b/Socket.IO-Client-Swift.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Socket.IO-Client-Swift" - s.version = "2.3.7" + s.version = "2.3.8" s.summary = "Socket.IO-client for iOS and OS X" s.description = <<-DESC Socket.IO-client for iOS and OS X. @@ -12,7 +12,7 @@ Pod::Spec.new do |s| s.author = { "Erik" => "nuclear.ace@gmail.com" } s.ios.deployment_target = '8.0' s.osx.deployment_target = '10.10' - s.source = { :git => "https://github.com/socketio/socket.io-client-swift.git", :tag => 'v2.3.7' } + s.source = { :git => "https://github.com/socketio/socket.io-client-swift.git", :tag => 'v2.3.8' } s.source_files = "SocketIOClientSwift/**/*.swift" s.requires_arc = true # s.dependency 'Starscream', '~> 0.9' # currently this repo includes Starscream swift files From c40b7c169f3ac805fff630349a56d5563669a33e Mon Sep 17 00:00:00 2001 From: NachoSoto Date: Mon, 13 Jul 2015 00:08:56 +0000 Subject: [PATCH 2/4] Updated BuildableName in schemes --- .../xcshareddata/xcschemes/SocketIO-Mac.xcscheme | 8 ++++---- .../xcshareddata/xcschemes/SocketIO-iOS.xcscheme | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Socket.IO-Client-Swift.xcodeproj/xcshareddata/xcschemes/SocketIO-Mac.xcscheme b/Socket.IO-Client-Swift.xcodeproj/xcshareddata/xcschemes/SocketIO-Mac.xcscheme index 9bf5dd2..967b6f7 100644 --- a/Socket.IO-Client-Swift.xcodeproj/xcshareddata/xcschemes/SocketIO-Mac.xcscheme +++ b/Socket.IO-Client-Swift.xcodeproj/xcshareddata/xcschemes/SocketIO-Mac.xcscheme @@ -15,7 +15,7 @@ @@ -57,7 +57,7 @@ @@ -76,7 +76,7 @@ @@ -94,7 +94,7 @@ diff --git a/Socket.IO-Client-Swift.xcodeproj/xcshareddata/xcschemes/SocketIO-iOS.xcscheme b/Socket.IO-Client-Swift.xcodeproj/xcshareddata/xcschemes/SocketIO-iOS.xcscheme index 5de6064..e9b0653 100644 --- a/Socket.IO-Client-Swift.xcodeproj/xcshareddata/xcschemes/SocketIO-iOS.xcscheme +++ b/Socket.IO-Client-Swift.xcodeproj/xcshareddata/xcschemes/SocketIO-iOS.xcscheme @@ -15,7 +15,7 @@ @@ -57,7 +57,7 @@ @@ -76,7 +76,7 @@ @@ -94,7 +94,7 @@ From 5f75e6080bebbe73ba63c2ff4c11a83bdee98a2e Mon Sep 17 00:00:00 2001 From: NachoSoto Date: Mon, 13 Jul 2015 00:09:05 +0000 Subject: [PATCH 3/4] Added SocketIOClient.removeAllHandlers --- SocketIOClientSwift/SocketIOClient.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/SocketIOClientSwift/SocketIOClient.swift b/SocketIOClientSwift/SocketIOClient.swift index 26ed4e0..0dffd87 100644 --- a/SocketIOClientSwift/SocketIOClient.swift +++ b/SocketIOClientSwift/SocketIOClient.swift @@ -448,6 +448,14 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketLogClient let handler = SocketEventHandler(event: event, callback: callback) handlers.append(handler) } + + /** + Removes all handlers. + Can be used after disconnecting to break any potential remaining retain cycles. + */ + public func removeAllHandlers() { + handlers.removeAll(keepCapacity: false) + } /** Adds a handler that will be called on every event. From 8928ce26939aec466e536843b292ecebf86e0a40 Mon Sep 17 00:00:00 2001 From: Erik Date: Sun, 12 Jul 2015 20:40:23 -0400 Subject: [PATCH 4/4] maybe fix socketio/socket.io-client-swift#100 and socketio/socket.io-client-swift#22 --- SocketIOClientSwift/SocketEngine.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SocketIOClientSwift/SocketEngine.swift b/SocketIOClientSwift/SocketEngine.swift index 356f912..86f4b5c 100644 --- a/SocketIOClientSwift/SocketEngine.swift +++ b/SocketIOClientSwift/SocketEngine.swift @@ -194,7 +194,9 @@ public final class SocketEngine: NSObject, WebSocketDelegate, SocketLogClient { } private func createWebsocket(andConnect connect:Bool) { - ws = WebSocket(url: NSURL(string: urlWebSocket! + "&sid=\(sid)")!, + let wsUrl = urlWebSocket! + (sid == "" ? "" : "&sid=\(sid)") + + ws = WebSocket(url: NSURL(string: wsUrl)!, cookies: cookies) if extraHeaders != nil {