Skip to content

Commit 70283ac

Browse files
committed
add messages to deprecated methods
1 parent e16914f commit 70283ac

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

Source/SocketEngine.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,13 @@ public final class SocketEngine: NSObject, SocketEnginePollable, SocketEngineWeb
123123
self.init(client: client, url: url, options: options?.toSocketOptionsSet() ?? [])
124124
}
125125

126-
@available(*, deprecated=5.3)
126+
@available(*, deprecated=5.3, message="Please use the NSURL based init")
127127
public convenience init(client: SocketEngineClient, urlString: String, options: Set<SocketIOClientOption>) {
128128
guard let url = NSURL(string: urlString) else { fatalError("Incorrect url") }
129129
self.init(client: client, url: url, options: options)
130130
}
131131

132-
@available(*, deprecated=5.3)
132+
@available(*, deprecated=5.3, message="Please use the NSURL based init")
133133
public convenience init(client: SocketEngineClient, urlString: String, options: NSDictionary?) {
134134
guard let url = NSURL(string: urlString) else { fatalError("Incorrect url") }
135135
self.init(client: client, url: url, options: options?.toSocketOptionsSet() ?? [])

Source/SocketIOClient.swift

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,13 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketParsable
102102
self.init(socketURL: socketURL, options: options?.toSocketOptionsSet() ?? [])
103103
}
104104

105-
/// Please use the NSURL based init
106-
@available(*, deprecated=5.3)
105+
@available(*, deprecated=5.3, message="Please use the NSURL based init")
107106
public convenience init(socketURLString: String, options: Set<SocketIOClientOption> = []) {
108107
guard let url = NSURL(string: socketURLString) else { fatalError("Incorrect url") }
109108
self.init(socketURL: url, options: options)
110109
}
111110

112-
/// Please use the NSURL based init
113-
@available(*, deprecated=5.3)
111+
@available(*, deprecated=5.3, message="Please use the NSURL based init")
114112
public convenience init(socketURLString: String, options: NSDictionary?) {
115113
guard let url = NSURL(string: socketURLString) else { fatalError("Incorrect url") }
116114
self.init(socketURL: url, options: options?.toSocketOptionsSet() ?? [])
@@ -134,7 +132,7 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketParsable
134132
reconnectTimer = nil
135133
}
136134

137-
@available(*, deprecated=5.3)
135+
@available(*, deprecated=5.3, message="Please use disconnect()")
138136
public func close() {
139137
disconnect()
140138
}
@@ -426,10 +424,7 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketParsable
426424
anyHandler = handler
427425
}
428426

429-
/**
430-
Same as connect
431-
*/
432-
@available(*, deprecated=5.3)
427+
@available(*, deprecated=5.3, message="Please use one of the connect methods)")
433428
public func open() {
434429
connect()
435430
}

0 commit comments

Comments
 (0)