From 70283acc1f1417ff286cdafebf62ecee96d9f11b Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 17 Feb 2016 14:27:48 -0500 Subject: [PATCH] add messages to deprecated methods --- Source/SocketEngine.swift | 4 ++-- Source/SocketIOClient.swift | 13 ++++--------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/Source/SocketEngine.swift b/Source/SocketEngine.swift index f08b67a..f0b06b0 100644 --- a/Source/SocketEngine.swift +++ b/Source/SocketEngine.swift @@ -123,13 +123,13 @@ public final class SocketEngine: NSObject, SocketEnginePollable, SocketEngineWeb self.init(client: client, url: url, options: options?.toSocketOptionsSet() ?? []) } - @available(*, deprecated=5.3) + @available(*, deprecated=5.3, message="Please use the NSURL based init") public convenience init(client: SocketEngineClient, urlString: String, options: Set) { guard let url = NSURL(string: urlString) else { fatalError("Incorrect url") } self.init(client: client, url: url, options: options) } - @available(*, deprecated=5.3) + @available(*, deprecated=5.3, message="Please use the NSURL based init") public convenience init(client: SocketEngineClient, urlString: String, options: NSDictionary?) { guard let url = NSURL(string: urlString) else { fatalError("Incorrect url") } self.init(client: client, url: url, options: options?.toSocketOptionsSet() ?? []) diff --git a/Source/SocketIOClient.swift b/Source/SocketIOClient.swift index c7f7f0a..a51b938 100644 --- a/Source/SocketIOClient.swift +++ b/Source/SocketIOClient.swift @@ -102,15 +102,13 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketParsable self.init(socketURL: socketURL, options: options?.toSocketOptionsSet() ?? []) } - /// Please use the NSURL based init - @available(*, deprecated=5.3) + @available(*, deprecated=5.3, message="Please use the NSURL based init") public convenience init(socketURLString: String, options: Set = []) { guard let url = NSURL(string: socketURLString) else { fatalError("Incorrect url") } self.init(socketURL: url, options: options) } - /// Please use the NSURL based init - @available(*, deprecated=5.3) + @available(*, deprecated=5.3, message="Please use the NSURL based init") public convenience init(socketURLString: String, options: NSDictionary?) { guard let url = NSURL(string: socketURLString) else { fatalError("Incorrect url") } self.init(socketURL: url, options: options?.toSocketOptionsSet() ?? []) @@ -134,7 +132,7 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketParsable reconnectTimer = nil } - @available(*, deprecated=5.3) + @available(*, deprecated=5.3, message="Please use disconnect()") public func close() { disconnect() } @@ -426,10 +424,7 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketParsable anyHandler = handler } - /** - Same as connect - */ - @available(*, deprecated=5.3) + @available(*, deprecated=5.3, message="Please use one of the connect methods)") public func open() { connect() }