Fixes build warnings caused by documentation issues.

This commit is contained in:
Henri Salminen 2018-01-30 14:28:58 +02:00
parent d388e1cf03
commit 8df1a12412
7 changed files with 18 additions and 22 deletions

View File

@ -108,7 +108,7 @@ public final class OnAckCallback : NSObject {
/// Completes an emitWithAck. If this isn't called, the emit never happens. /// Completes an emitWithAck. If this isn't called, the emit never happens.
/// ///
/// - parameter after: The number of seconds before this emit times out if an ack hasn't been received. /// - parameter seconds: The number of seconds before this emit times out if an ack hasn't been received.
/// - parameter callback: The callback called when an ack is received, or when a timeout happens. /// - parameter callback: The callback called when an ack is received, or when a timeout happens.
/// To check for timeout, use `SocketAckStatus`'s `noAck` case. /// To check for timeout, use `SocketAckStatus`'s `noAck` case.
@objc @objc

View File

@ -86,7 +86,7 @@ open class SocketIOClient : NSObject, SocketIOClientSpec {
/// Type safe way to create a new SocketIOClient. `opts` can be omitted. /// Type safe way to create a new SocketIOClient. `opts` can be omitted.
/// ///
/// - parameter manager: The manager for this socket. /// - parameter manager: The manager for this socket.
/// - parameter socketURL: The url of the socket.io server. /// - parameter nsp: The namespace of the socket.
@objc @objc
public init(manager: SocketManagerSpec, nsp: String) { public init(manager: SocketManagerSpec, nsp: String) {
self.manager = manager self.manager = manager
@ -115,7 +115,7 @@ open class SocketIOClient : NSObject, SocketIOClientSpec {
/// ///
/// - parameter timeoutAfter: The number of seconds after which if we are not connected we assume the connection /// - parameter timeoutAfter: The number of seconds after which if we are not connected we assume the connection
/// has failed. Pass 0 to never timeout. /// has failed. Pass 0 to never timeout.
/// - parameter withHandler: The handler to call when the client fails to connect. /// - parameter handler: The handler to call when the client fails to connect.
@objc @objc
open func connect(timeoutAfter: Double, withHandler handler: (() -> ())?) { open func connect(timeoutAfter: Double, withHandler handler: (() -> ())?) {
assert(timeoutAfter >= 0, "Invalid timeout: \(timeoutAfter)") assert(timeoutAfter >= 0, "Invalid timeout: \(timeoutAfter)")
@ -213,7 +213,7 @@ open class SocketIOClient : NSObject, SocketIOClientSpec {
/// Same as emit, but meant for Objective-C /// Same as emit, but meant for Objective-C
/// ///
/// - parameter event: The event to send. /// - parameter event: The event to send.
/// - parameter with: The items to send with this event. Send an empty array to send no data. /// - parameter items: The items to send with this event. Send an empty array to send no data.
@objc @objc
open func emit(_ event: String, with items: [Any]) { open func emit(_ event: String, with items: [Any]) {
guard status == .connected else { guard status == .connected else {
@ -270,7 +270,7 @@ open class SocketIOClient : NSObject, SocketIOClientSpec {
/// ``` /// ```
/// ///
/// - parameter event: The event to send. /// - parameter event: The event to send.
/// - parameter with: The items to send with this event. Use `[]` to send nothing. /// - parameter items: The items to send with this event. Use `[]` to send nothing.
/// - returns: An `OnAckCallback`. You must call the `timingOut(after:)` method before the event will be sent. /// - returns: An `OnAckCallback`. You must call the `timingOut(after:)` method before the event will be sent.
@objc @objc
open func emitWithAck(_ event: String, with items: [Any]) -> OnAckCallback { open func emitWithAck(_ event: String, with items: [Any]) -> OnAckCallback {
@ -334,7 +334,7 @@ open class SocketIOClient : NSObject, SocketIOClientSpec {
/// - parameter event: The name of the event. /// - parameter event: The name of the event.
/// - parameter data: The data that was sent with this event. /// - parameter data: The data that was sent with this event.
/// - parameter isInternalMessage: Whether this event was sent internally. If `true` it is always sent to handlers. /// - parameter isInternalMessage: Whether this event was sent internally. If `true` it is always sent to handlers.
/// - parameter withAck: If > 0 then this event expects to get an ack back from the client. /// - parameter ack: If > 0 then this event expects to get an ack back from the client.
@objc @objc
open func handleEvent(_ event: String, data: [Any], isInternalMessage: Bool, withAck ack: Int = -1) { open func handleEvent(_ event: String, data: [Any], isInternalMessage: Bool, withAck ack: Int = -1) {
guard status == .connected || isInternalMessage else { return } guard status == .connected || isInternalMessage else { return }

View File

@ -59,7 +59,7 @@ public protocol SocketIOClientSpec : class {
/// ///
/// - parameter timeoutAfter: The number of seconds after which if we are not connected we assume the connection /// - parameter timeoutAfter: The number of seconds after which if we are not connected we assume the connection
/// has failed. Pass 0 to never timeout. /// has failed. Pass 0 to never timeout.
/// - parameter withHandler: The handler to call when the client fails to connect. /// - parameter handler: The handler to call when the client fails to connect.
func connect(timeoutAfter: Double, withHandler handler: (() -> ())?) func connect(timeoutAfter: Double, withHandler handler: (() -> ())?)
/// Called when the client connects to a namespace. If the client was created with a namespace upfront, /// Called when the client connects to a namespace. If the client was created with a namespace upfront,
@ -134,7 +134,7 @@ public protocol SocketIOClientSpec : class {
/// - parameter event: The name of the event. /// - parameter event: The name of the event.
/// - parameter data: The data that was sent with this event. /// - parameter data: The data that was sent with this event.
/// - parameter isInternalMessage: Whether this event was sent internally. If `true` it is always sent to handlers. /// - parameter isInternalMessage: Whether this event was sent internally. If `true` it is always sent to handlers.
/// - parameter withAck: If > 0 then this event expects to get an ack back from the client. /// - parameter ack: If > 0 then this event expects to get an ack back from the client.
func handleEvent(_ event: String, data: [Any], isInternalMessage: Bool, withAck ack: Int) func handleEvent(_ event: String, data: [Any], isInternalMessage: Bool, withAck ack: Int)
/// Causes a client to handle a socket.io packet. The namespace for the packet must match the namespace of the /// Causes a client to handle a socket.io packet. The namespace for the packet must match the namespace of the

View File

@ -461,8 +461,6 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
/// Parses a raw engine.io packet. /// Parses a raw engine.io packet.
/// ///
/// - parameter message: The message to parse. /// - parameter message: The message to parse.
/// - parameter fromPolling: Whether this message is from long-polling.
/// If `true` we might have to fix utf8 encoding.
public func parseEngineMessage(_ message: String) { public func parseEngineMessage(_ message: String) {
DefaultSocketLogger.Logger.log("Got message: \(message)", type: SocketEngine.logType) DefaultSocketLogger.Logger.log("Got message: \(message)", type: SocketEngine.logType)
@ -586,8 +584,8 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
/// Writes a message to engine.io, independent of transport. /// Writes a message to engine.io, independent of transport.
/// ///
/// - parameter msg: The message to send. /// - parameter msg: The message to send.
/// - parameter withType: The type of this message. /// - parameter type: The type of this message.
/// - parameter withData: Any data that this message has. /// - parameter data: Any data that this message has.
public func write(_ msg: String, withType type: SocketEnginePacketType, withData data: [Data]) { public func write(_ msg: String, withType type: SocketEnginePacketType, withData data: [Data]) {
engineQueue.async { engineQueue.async {
guard self.connected else { return } guard self.connected else { return }

View File

@ -130,15 +130,13 @@ import Starscream
/// Parses a raw engine.io packet. /// Parses a raw engine.io packet.
/// ///
/// - parameter message: The message to parse. /// - parameter message: The message to parse.
/// - parameter fromPolling: Whether this message is from long-polling.
/// If `true` we might have to fix utf8 encoding.
func parseEngineMessage(_ message: String) func parseEngineMessage(_ message: String)
/// Writes a message to engine.io, independent of transport. /// Writes a message to engine.io, independent of transport.
/// ///
/// - parameter msg: The message to send. /// - parameter msg: The message to send.
/// - parameter withType: The type of this message. /// - parameter type: The type of this message.
/// - parameter withData: Any data that this message has. /// - parameter data: Any data that this message has.
func write(_ msg: String, withType type: SocketEnginePacketType, withData data: [Data]) func write(_ msg: String, withType type: SocketEnginePacketType, withData data: [Data])
} }

View File

@ -241,7 +241,7 @@ open class SocketManager : NSObject, SocketManagerSpec, SocketParsable, SocketDa
/// This will remove the socket for the manager's control, and make the socket instance useless and ready for /// This will remove the socket for the manager's control, and make the socket instance useless and ready for
/// releasing. /// releasing.
/// ///
/// - parameter forNamespace: The namespace to disconnect from. /// - parameter nsp: The namespace to disconnect from.
open func disconnectSocket(forNamespace nsp: String) { open func disconnectSocket(forNamespace nsp: String) {
guard let socket = nsps.removeValue(forKey: nsp) else { guard let socket = nsps.removeValue(forKey: nsp) else {
DefaultSocketLogger.Logger.log("Could not find socket for \(nsp) to disconnect", DefaultSocketLogger.Logger.log("Could not find socket for \(nsp) to disconnect",
@ -282,7 +282,7 @@ open class SocketManager : NSObject, SocketManagerSpec, SocketParsable, SocketDa
/// Same as `emitAll(_:_:)`, but meant for Objective-C. /// Same as `emitAll(_:_:)`, but meant for Objective-C.
/// ///
/// - parameter event: The event to send. /// - parameter event: The event to send.
/// - parameter withItems: The data to send with this event. /// - parameter items: The data to send with this event.
open func emitAll(_ event: String, withItems items: [Any]) { open func emitAll(_ event: String, withItems items: [Any]) {
forAll {socket in forAll {socket in
socket.emit(event, with: items) socket.emit(event, with: items)
@ -508,7 +508,7 @@ open class SocketManager : NSObject, SocketManagerSpec, SocketParsable, SocketDa
/// Call one of the `disconnectSocket` methods on this class to remove the socket from manager control. /// Call one of the `disconnectSocket` methods on this class to remove the socket from manager control.
/// Or call `SocketIOClient.disconnect()` on the client. /// Or call `SocketIOClient.disconnect()` on the client.
/// ///
/// - parameter forNamespace: The namespace for the socket. /// - parameter nsp: The namespace for the socket.
/// - returns: A `SocketIOClient` for the given namespace. /// - returns: A `SocketIOClient` for the given namespace.
open func socket(forNamespace nsp: String) -> SocketIOClient { open func socket(forNamespace nsp: String) -> SocketIOClient {
assert(nsp.hasPrefix("/"), "forNamespace must have a leading /") assert(nsp.hasPrefix("/"), "forNamespace must have a leading /")

View File

@ -103,13 +103,13 @@ public protocol SocketManagerSpec : class, SocketEngineClient {
/// Disconnects the socket associated with `forNamespace`. /// Disconnects the socket associated with `forNamespace`.
/// ///
/// - parameter forNamespace: The namespace to disconnect from. /// - parameter nsp: The namespace to disconnect from.
func disconnectSocket(forNamespace nsp: String) func disconnectSocket(forNamespace nsp: String)
/// Sends an event to the server on all namespaces in this manager. /// Sends an event to the server on all namespaces in this manager.
/// ///
/// - parameter event: The event to send. /// - parameter event: The event to send.
/// - parameter withItems: The data to send with this event. /// - parameter items: The data to send with this event.
func emitAll(_ event: String, withItems items: [Any]) func emitAll(_ event: String, withItems items: [Any])
/// Tries to reconnect to the server. /// Tries to reconnect to the server.
@ -133,7 +133,7 @@ public protocol SocketManagerSpec : class, SocketEngineClient {
/// Call one of the `disconnectSocket` methods on the implementing class to remove the socket from manager control. /// Call one of the `disconnectSocket` methods on the implementing class to remove the socket from manager control.
/// Or call `SocketIOClient.disconnect()` on the client. /// Or call `SocketIOClient.disconnect()` on the client.
/// ///
/// - parameter forNamespace: The namespace for the socket. /// - parameter nsp: The namespace for the socket.
/// - returns: A `SocketIOClient` for the given namespace. /// - returns: A `SocketIOClient` for the given namespace.
func socket(forNamespace nsp: String) -> SocketIOClient func socket(forNamespace nsp: String) -> SocketIOClient
} }