Merge pull request #941 from Sproketti/documentation_fix
Fixes build warnings caused by documentation issues.
This commit is contained in:
		
						commit
						1e29b2047d
					
				@ -108,7 +108,7 @@ public final class OnAckCallback : NSObject {
 | 
			
		||||
 | 
			
		||||
    /// 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.
 | 
			
		||||
    ///                       To check for timeout, use `SocketAckStatus`'s `noAck` case.
 | 
			
		||||
    @objc
 | 
			
		||||
 | 
			
		||||
@ -86,7 +86,7 @@ open class SocketIOClient : NSObject, SocketIOClientSpec {
 | 
			
		||||
    /// Type safe way to create a new SocketIOClient. `opts` can be omitted.
 | 
			
		||||
    ///
 | 
			
		||||
    /// - parameter manager: The manager for this socket.
 | 
			
		||||
    /// - parameter socketURL: The url of the socket.io server.
 | 
			
		||||
    /// - parameter nsp: The namespace of the socket.
 | 
			
		||||
    @objc
 | 
			
		||||
    public init(manager: SocketManagerSpec, nsp: String) {
 | 
			
		||||
        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
 | 
			
		||||
    ///                           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
 | 
			
		||||
    open func connect(timeoutAfter: Double, withHandler handler: (() -> ())?) {
 | 
			
		||||
        assert(timeoutAfter >= 0, "Invalid timeout: \(timeoutAfter)")
 | 
			
		||||
@ -213,7 +213,7 @@ open class SocketIOClient : NSObject, SocketIOClientSpec {
 | 
			
		||||
    /// Same as emit, but meant for Objective-C
 | 
			
		||||
    ///
 | 
			
		||||
    /// - 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
 | 
			
		||||
    open func emit(_ event: String, with items: [Any]) {
 | 
			
		||||
        guard status == .connected else {
 | 
			
		||||
@ -270,7 +270,7 @@ open class SocketIOClient : NSObject, SocketIOClientSpec {
 | 
			
		||||
    /// ```
 | 
			
		||||
    ///
 | 
			
		||||
    /// - 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.
 | 
			
		||||
    @objc
 | 
			
		||||
    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 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 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
 | 
			
		||||
    open func handleEvent(_ event: String, data: [Any], isInternalMessage: Bool, withAck ack: Int = -1) {
 | 
			
		||||
        guard status == .connected || isInternalMessage else { return }
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
    ///                           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: (() -> ())?)
 | 
			
		||||
 | 
			
		||||
    /// 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 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 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)
 | 
			
		||||
 | 
			
		||||
    /// Causes a client to handle a socket.io packet. The namespace for the packet must match the namespace of the
 | 
			
		||||
 | 
			
		||||
@ -461,8 +461,6 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
 | 
			
		||||
    /// Parses a raw engine.io packet.
 | 
			
		||||
    ///
 | 
			
		||||
    /// - 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) {
 | 
			
		||||
        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.
 | 
			
		||||
    ///
 | 
			
		||||
    /// - parameter msg: The message to send.
 | 
			
		||||
    /// - parameter withType: The type of this message.
 | 
			
		||||
    /// - parameter withData: Any data that this message has.
 | 
			
		||||
    /// - parameter type: The type of this message.
 | 
			
		||||
    /// - parameter data: Any data that this message has.
 | 
			
		||||
    public func write(_ msg: String, withType type: SocketEnginePacketType, withData data: [Data]) {
 | 
			
		||||
        engineQueue.async {
 | 
			
		||||
            guard self.connected else { return }
 | 
			
		||||
 | 
			
		||||
@ -130,15 +130,13 @@ import Starscream
 | 
			
		||||
    /// Parses a raw engine.io packet.
 | 
			
		||||
    ///
 | 
			
		||||
    /// - 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)
 | 
			
		||||
 | 
			
		||||
    /// Writes a message to engine.io, independent of transport.
 | 
			
		||||
    ///
 | 
			
		||||
    /// - parameter msg: The message to send.
 | 
			
		||||
    /// - parameter withType: The type of this message.
 | 
			
		||||
    /// - parameter withData: Any data that this message has.
 | 
			
		||||
    /// - parameter type: The type of this message.
 | 
			
		||||
    /// - parameter data: Any data that this message has.
 | 
			
		||||
    func write(_ msg: String, withType type: SocketEnginePacketType, withData data: [Data])
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
    /// releasing.
 | 
			
		||||
    ///
 | 
			
		||||
    /// - parameter forNamespace: The namespace to disconnect from.
 | 
			
		||||
    /// - parameter nsp: The namespace to disconnect from.
 | 
			
		||||
    open func disconnectSocket(forNamespace nsp: String) {
 | 
			
		||||
        guard let socket = nsps.removeValue(forKey: nsp) else {
 | 
			
		||||
            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.
 | 
			
		||||
    ///
 | 
			
		||||
    /// - 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]) {
 | 
			
		||||
        forAll {socket in
 | 
			
		||||
            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.
 | 
			
		||||
    /// 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.
 | 
			
		||||
    open func socket(forNamespace nsp: String) -> SocketIOClient {
 | 
			
		||||
        assert(nsp.hasPrefix("/"), "forNamespace must have a leading /")
 | 
			
		||||
 | 
			
		||||
@ -103,13 +103,13 @@ public protocol SocketManagerSpec : class, SocketEngineClient {
 | 
			
		||||
 | 
			
		||||
    /// 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)
 | 
			
		||||
 | 
			
		||||
    /// Sends an event to the server on all namespaces in this manager.
 | 
			
		||||
    ///
 | 
			
		||||
    /// - 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])
 | 
			
		||||
 | 
			
		||||
    /// 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.
 | 
			
		||||
    /// 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.
 | 
			
		||||
    func socket(forNamespace nsp: String) -> SocketIOClient
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user