From c40b7c169f3ac805fff630349a56d5563669a33e Mon Sep 17 00:00:00 2001 From: NachoSoto Date: Mon, 13 Jul 2015 00:08:56 +0000 Subject: [PATCH 1/2] 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 2/2] 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.