diff --git a/README.md b/README.md index eb51b9b..ccf3a80 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,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`. @@ -80,7 +80,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 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 @@ diff --git a/SocketIOClientSwift/SocketIOClient.swift b/SocketIOClientSwift/SocketIOClient.swift index 7214803..2660092 100644 --- a/SocketIOClientSwift/SocketIOClient.swift +++ b/SocketIOClientSwift/SocketIOClient.swift @@ -432,6 +432,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.