From 6f1f25f9620fe4fae6dcf22d1560b6e132cc6f21 Mon Sep 17 00:00:00 2001 From: Loay Ashraf Date: Sat, 27 Jan 2024 19:05:01 +0200 Subject: [PATCH] fix: lint documentation Resolves: none. --- Docs.docc/Articles/ConnectingToWebSocket.md | 8 ++++---- Examples/iOS/iOS Example/Controller/ViewController.swift | 8 -------- .../Types/Request/Event/HTTPDownloadRequestEvent.swift | 3 +++ .../HTTP/Types/Request/Event/HTTPUploadRequestEvent.swift | 2 ++ .../Request/Parameters/HTTPUploadRequestFormData.swift | 2 +- 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/Docs.docc/Articles/ConnectingToWebSocket.md b/Docs.docc/Articles/ConnectingToWebSocket.md index a2300a6..9417bf3 100644 --- a/Docs.docc/Articles/ConnectingToWebSocket.md +++ b/Docs.docc/Articles/ConnectingToWebSocket.md @@ -4,7 +4,7 @@ Connect to a web socket server with **RxNetworkKit** ## Overview -In this article we will walk you through on how to connect to a web socket server and how to send/receive messages and data. +In this article we will walk you through on how to connect to a web socket server and how to send/receive messages. ### Creating a http client @@ -39,7 +39,7 @@ class ViewController: UIViewController { ### Connecting to a websocket server -In this section, you will create a ``WebSocket`` and send/receive messages and data to/from the server. +In this section, you will create a ``WebSocket`` and send/receive messages to/from the server. - First, call the `HTTPClient.websocket` method and pass the server url, protocols and close handler as arguments. @@ -91,9 +91,9 @@ class ViewController: UIViewController { } ``` -- Optionally, you can send messages and data via the `WebSocket.send(_:)` method. +- Optionally, you can send messages to the server via the `WebSocket.send(_:)` method. -- That's it, you are connected to a web socket server and ready to send/receive messages and data. +- That's it, you are connected to a web socket server and ready to send/receive messages. - Tip: You can disconnect from the web socket server at any time by calling the `WebSocket.disconnect` method. diff --git a/Examples/iOS/iOS Example/Controller/ViewController.swift b/Examples/iOS/iOS Example/Controller/ViewController.swift index 070b86f..01fa751 100644 --- a/Examples/iOS/iOS Example/Controller/ViewController.swift +++ b/Examples/iOS/iOS Example/Controller/ViewController.swift @@ -46,14 +46,6 @@ class ViewController: UIViewController { let restClient = RESTClient(session: session, requestInterceptor: requestInterceptor) let httpClient = HTTPClient(session: session, requestInterceptor: requestInterceptor) viewModel = .init(restClient: restClient, httpClient: httpClient) - NetworkReachability.shared.didBecomeReachable - .subscribe(onNext: { - // print that the network became reachable - print("Network did become reachable!") - }) - .disposed(by: disposeBag) - NetworkReachability.shared.setInterfaceTypes(NetworkInterfaceType.allCases) - NetworkReachability.shared.start() } /// Sets up views. private func setupUI() { diff --git a/Source/HTTP/Types/Request/Event/HTTPDownloadRequestEvent.swift b/Source/HTTP/Types/Request/Event/HTTPDownloadRequestEvent.swift index 91cbb1e..5a115b5 100644 --- a/Source/HTTP/Types/Request/Event/HTTPDownloadRequestEvent.swift +++ b/Source/HTTP/Types/Request/Event/HTTPDownloadRequestEvent.swift @@ -9,7 +9,10 @@ import Foundation /// An enumeration of the types of events received during a download operation. public enum HTTPDownloadRequestEvent { + /// The download request has completed with the file saved to the disk. case completed + /// The download request has completed with the file data. case completedWithData(data: Data?) + /// The download request has progressed. case progress(progress: Progress) } diff --git a/Source/HTTP/Types/Request/Event/HTTPUploadRequestEvent.swift b/Source/HTTP/Types/Request/Event/HTTPUploadRequestEvent.swift index 8089d82..0d2ebd6 100644 --- a/Source/HTTP/Types/Request/Event/HTTPUploadRequestEvent.swift +++ b/Source/HTTP/Types/Request/Event/HTTPUploadRequestEvent.swift @@ -9,6 +9,8 @@ import Foundation /// An enumeration of the types of events received during an upload operation. public enum HTTPUploadRequestEvent { + /// The upload request has completed with a response body. case completed(model: T) + /// The upload request has progressed. case progress(progress: Progress) } diff --git a/Source/HTTP/Types/Request/Parameters/HTTPUploadRequestFormData.swift b/Source/HTTP/Types/Request/Parameters/HTTPUploadRequestFormData.swift index cfc1e82..3fd387e 100644 --- a/Source/HTTP/Types/Request/Parameters/HTTPUploadRequestFormData.swift +++ b/Source/HTTP/Types/Request/Parameters/HTTPUploadRequestFormData.swift @@ -7,7 +7,7 @@ import Foundation -/// Holds details for a mulipart form upload. +/// Holds details for a mulipart form upload request. public struct HTTPUploadRequestFormData { /// parameters (text data fields) to be included in the form HTTP body.