Created
January 17, 2023 12:22
-
-
Save dinotrnka/eb7628f36e59f77923d2a3ba43c7b1bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
static func call( | |
scheme: String = Config.shared.scheme, | |
host: String = Config.shared.host, | |
path: String, | |
method: HTTPMethod, | |
parameters: Parameters? = nil, | |
completion: @escaping CompletionHandler, | |
failure: @escaping FailureHandler | |
) { | |
if !NetworkMonitor.shared.isReachable { // Added this | |
return failure(.noInternet) | |
} | |
var components = URLComponents() | |
components.scheme = scheme | |
components.host = host | |
components.path = path | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment