diff --git a/Networking-Example/Pods/Manifest.lock b/Networking-Example/Pods/Manifest.lock index 5670e04..c991b89 100644 --- a/Networking-Example/Pods/Manifest.lock +++ b/Networking-Example/Pods/Manifest.lock @@ -1,5 +1,5 @@ PODS: - - Networking-Swift (0.8.9) + - Networking-Swift (0.9.0) DEPENDENCIES: - Networking-Swift @@ -9,8 +9,8 @@ SPEC REPOS: - Networking-Swift SPEC CHECKSUMS: - Networking-Swift: b3713108e9baa1e6cf07333d6cf35e483295974e + Networking-Swift: 86529d4a3a3123bc0d190c577f00bfb6c44bd02e PODFILE CHECKSUM: 2c5e9876a119abb0735997db7330924e72930e0a -COCOAPODS: 1.11.3 +COCOAPODS: 1.15.2 diff --git a/Networking-Example/Pods/Networking-Swift/LICENSE b/Networking-Example/Pods/Networking-Swift/LICENSE index 7e1db96..f2a0d74 100644 --- a/Networking-Example/Pods/Networking-Swift/LICENSE +++ b/Networking-Example/Pods/Networking-Swift/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 Viktor Gidlöf +Copyright (c) 2024 Viktor Gidlöf Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Networking-Example/Pods/Networking-Swift/README.md b/Networking-Example/Pods/Networking-Swift/README.md index 408191e..0c99ef3 100644 --- a/Networking-Example/Pods/Networking-Swift/README.md +++ b/Networking-Example/Pods/Networking-Swift/README.md @@ -1,17 +1,17 @@ ![network-header](https://user-images.githubusercontent.com/15960525/206866384-044ca1d7-172d-4d5f-80f7-7ee234f2a363.png) -![workflow](https://img.shields.io/github/workflow/status/brillcp/networking/Networking?event=push) +![workflow](https://img.shields.io/github/actions/workflow/status/brillcp/networking/swift.yml?branch=master&event=push) ![release](https://img.shields.io/github/v/release/brillcp/networking) ![swift](https://img.shields.io/badge/Swift-5.4%2B-orange) ![platforms](https://img.shields.io/badge/Platforms-iOS%20macOS%20tvOS%20watchOS-blue) [![spm](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-green)](#swift-package-manager) -[![pod](https://img.shields.io/badge/pod-v0.8.9-orange)](#cocoapods) +[![pod](https://img.shields.io/badge/pod-v0.9.0-orange)](#cocoapods) [![license](https://img.shields.io/github/license/brillcp/networking)](/LICENSE) ![stars](https://img.shields.io/github/stars/brillcp/networking?style=social) -Networking is a lightweight and powerful HTTP network framework written in Swift by [Viktor Gidlöf](https://viktorgidlof.com). It uses `Combine` and `URLSession` for network calls and can be used as a network layer for any REST API on iOS, macOS, tvOS and watchOS. +Networking is a lightweight and powerful HTTP network framework written in Swift by [Viktor Gidlöf](https://viktorgidlof.com). It uses `await / async` and `URLSession` for network calls and can be used as a network layer for any REST API on iOS, macOS, tvOS and watchOS. -- [Features](#features-) +- [Features](#features) - [Requirements](#requirements-%EF%B8%8F) - [Usage](#usage-) - [Logging](#logging-) @@ -26,6 +26,7 @@ Networking is a lightweight and powerful HTTP network framework written in Swift - [Installation](#installation-) - [Swift Package Manager](#swift-package-manager) - [CocoaPods](#cocoapods) +- [Sample code](#sample-code-) - [Contribution](#contribution-) - [License](#license-) @@ -36,7 +37,7 @@ Networking is a lightweight and powerful HTTP network framework written in Swift - [x] Authentication with Basic and Bearer token - [x] Download files with progress - [x] Simple and clean syntax - - [x] Combine Support + - [x] Await / async ## Requirements ❗️ | Platform | Min. Swift Version | Installation @@ -47,8 +48,7 @@ Networking is a lightweight and powerful HTTP network framework written in Swift | watchOS 6.0+ | 5.4 | [CocoaPods](#cocoapods), [Swift Package Manager](#swift-package-manager) | ## Usage 🕹 -Networking uses `Combine`, `URLSession` and `dataTaskPublishers` and is made up of three main components: - +Networking is built around three core components: - [`Network.Service`](Sources/Service/NetworkService.swift) - [`ServerConfig`](Sources/ServerConfig/ServerConfig.swift) - [`Requestable`](Sources/Protocols/Requestable.swift) @@ -58,8 +58,6 @@ It is initialized with a server configuration that determines the API base url a Start by creating a requestable object. Typically an `enum` that conforms to `Requestable`: ```swift -import Networking - enum GitHubUserRequest: Requestable { case user(String) @@ -82,8 +80,6 @@ enum GitHubUserRequest: Requestable { The [`EndpointType`](Sources/Protocols/EndpointType.swift) can be defined as an `enum` that contains all the possible endpoints for an API: ```swift -import Networking - enum Endpoint { case user(String) case repos(String) @@ -106,8 +102,6 @@ extension Endpoint: EndpointType { Then simply create a server configuration and a new network service and make a request: ```swift -import Networking - let serverConfig = ServerConfig(baseURL: "https://api.github.com") let networkService = Network.Service(server: serverConfig) let user = GitHubUserRequest.user("brillcp") @@ -164,8 +158,6 @@ It involves creating a server configuration with a token provider object. The [` The point of the token provider is to persist an authentication token on the device and then use that token to authenticate requests. The following implementation demonstrates how a bearer token can be retrieved from the device using `UserDefaults`, but as mentioned, it can be any persistant storage: ```swift -import Networking - final class TokenProvider { private static let tokenKey = "com.example.ios.jwt.key" private let defaults: UserDefaults @@ -176,7 +168,6 @@ final class TokenProvider { } extension TokenProvider: TokenProvidable { - var token: Result { guard let token = defaults.string(forKey: Self.tokenKey) else { return .failure(.missing) } return .success(token) @@ -194,8 +185,6 @@ extension TokenProvider: TokenProvidable { In order to use this authentication token just implement the `authorization` property on the requests that require authentication: ```swift -import Networking - enum AuthenticatedRequest: Requestable { // ... var authorization: Authorization { .bearer } @@ -210,8 +199,6 @@ let server = ServerConfig(baseURL: "https://api.github.com", tokenProvider: Toke ### Adding parameters Adding parameters to a request is done by implementing the `parameters` property on a request: ```swift -import Networking - enum Request: Requestable { case getData(String) @@ -241,8 +228,6 @@ var encoding: Request.Encoding { .body } // Encode parameters as a string in the ### Making `POST` requests Making post requests to a backend API is done by setting the `httpMethod` property to `.post` and provide parameters: ```swift -import Networking - enum PostRequest: Requestable { case postData(String) @@ -273,39 +258,35 @@ print(parameters) // ["name": "Günther", "age": "69"] This is useful if you have any data model objects that you want to send as parameters in any requests. ### Check HTTP status codes -Sometimes it can be useful to just check for a HTTP status code when a response comes back. Use [`responsePublisher`](Sources/Service/NetworkService.swift#L81) to send a request and get back the status code in the response: +Sometimes it can be useful to just check for a HTTP status code when a response comes back. Use [`response`](Sources/Service/NetworkService.swift#L66) to send a request and get back the status code in the response: ```swift -import Networking - -// ... - -let cancellable = try networkService.responsePublisher(request).sink { result in - switch result { - case .success(let responseCode): - print(responseCode == .ok) // True, if the response has HTTP status code 200 - case .failure(let error): - // Handle error - } -} +let usersRequest = ... +let responseCode = try await networkService.response(usersRequest) +print(responseCode == .ok) ``` Networking supports all the status codes defined in the HTTP protocol, [see here](Sources/HTTP/StatusCode.swift). ### Download progress -Download files and track and report the download progress by using [`downloadPublisher`](Sources/Service/NetworkService.swift#L91). The progress is tracked by sinking the publisher to a result object and the `.success(.progress)` case reports the progress and when a file has finished downloading, the `.success(.destination)` case is invoked and it provides a URL to the temporary file destination on the device. -```swift -import Networking +You can download files and track progress asynchronously using the [`downloader.download()`](Sources/Service/NetworkService.swift#L75). This function returns a tuple containing the file’s download URL and an `AsyncStream` to observe the progress of the download. The AsyncStream will yield progress updates from 0.0 to 1.0 as the download progresses. When the download completes, the final destination URL is provided. +```swift let url = ... -let cancellable = networkService.downloadPublisher(url: url).sink { result in - switch result { - case .success(.progress(let progress)): +do { + let downloader = networkService.downloader(url: url!) + let (fileURL, progress) = try await downloader.download() + + // Track download progress + for await progress in progressStream { // The download progress: 0.0 ... 1.0 - case .success(.destination(let url)): - // The temporary file destination: file:///var/folders/ ... /CFNetworkDownload_6JpDuF.tmp - case .failure(let error): - // Handle error + print("Download progress: \(progress * 100)%") } + + // The final destination URL + print("Download completed at: \(downloadedURL)") +} catch { + // Handle error + print("Download failed: \(error)") } ``` @@ -315,7 +296,7 @@ The Swift Package Manager is a tool for automating the distribution of Swift cod Once you have your Swift package set up, adding Networking as a dependency is as easy as adding it to the dependencies value of your Package.swift. ``` dependencies: [ - .package(url: "https://github.com/brillcp/Networking.git", .upToNextMajor(from: "0.8.9")) + .package(url: "https://github.com/brillcp/Networking.git", .upToNextMajor(from: "0.9.0")) ] ``` @@ -325,6 +306,13 @@ dependencies: [ pod 'Networking-Swift' ``` +## Sample code 📱 +The sample project is a small application that demonstrates some of the functionality of the framework. Start by cloning the repo: +``` +git clone https://github.com/brillcp/Networking.git +``` +Open the workspace `Networking-Example.xcworkspace` and run. + ## Contribution 🛠 - [Create an issue](https://github.com/brillcp/networking/issues/new) if you: - Are struggling or have any questions diff --git a/Networking-Example/Pods/Networking-Swift/Sources/Extensions/DataTaskPublisher.swift b/Networking-Example/Pods/Networking-Swift/Sources/Extensions/DataTaskPublisher.swift deleted file mode 100644 index cc5a2b4..0000000 --- a/Networking-Example/Pods/Networking-Swift/Sources/Extensions/DataTaskPublisher.swift +++ /dev/null @@ -1,58 +0,0 @@ -// -// DataTaskPublisher.swift -// Networking -// -// Created by Viktor Gidlöf. -// - -import Foundation -import Combine - -public extension URLSession.DataTaskPublisher { - /// Log the incoming response to the console - /// - parameter printJSON: A bool value that determines if the json respons is also printed to the console. Defaults to true. - /// - returns: The current publisher in the pipeline - func logResponse(printJSON: Bool = true) -> Publishers.HandleEvents { - handleEvents(receiveOutput: { value in - guard let httpResponse = value.response as? HTTPURLResponse, - let url = httpResponse.url?.absoluteString, - let comps = URLComponents(string: url), - let host = comps.host - else { return } - - Swift.print("♻️ Incoming response from \(host) @ \(Date())") - - let statusCode = httpResponse.statusCode - let statusCodeString = HTTPURLResponse.localizedString(forStatusCode: statusCode) - let path = comps.path - - var printOutput = "~ \(path)\n" - printOutput += "Status-Code: \(statusCode)\n" - printOutput += "Localized Status-Code: \(statusCodeString)\n" - - httpResponse.allHeaderFields.forEach { key, value in - if key.description == HTTP.Header.Field.contentLength || key.description == HTTP.Header.Field.contentType { - printOutput += "\(key): \(value)\n" - } - } - - Swift.print(printOutput) - if printJSON { - Swift.print("JSON response:") - Swift.print(value.data.prettyPrinted ?? "") - } - }) - } -} - -// MARK: - -private extension Data { - - /// Convert data into an optional pretty printed json string. - var prettyPrinted: String? { - guard let object = try? JSONSerialization.jsonObject(with: self, options: []), - let data = try? JSONSerialization.data(withJSONObject: object, options: [.prettyPrinted]) - else { return nil } - return String(data: data, encoding: .utf8) - } -} diff --git a/Networking-Example/Pods/Networking-Swift/Sources/Extensions/String.swift b/Networking-Example/Pods/Networking-Swift/Sources/Extensions/String.swift index 37286d9..312f7bb 100644 --- a/Networking-Example/Pods/Networking-Swift/Sources/Extensions/String.swift +++ b/Networking-Example/Pods/Networking-Swift/Sources/Extensions/String.swift @@ -10,8 +10,8 @@ import Foundation public extension String { /// Create a URL from the string /// - returns: A new URL based on the given string value - func asURL() -> URL { - guard let url = URL(string: self) else { fatalError("The URL could not be created ❌ This should never happen!") } + func asURL() -> URL? { + guard let url = URL(string: self) else { return nil } return url } @@ -21,4 +21,45 @@ public extension String { func basicAuthentication(password: String) -> String { Data("\(self):\(password)".utf8).base64EncodedString() } + + static func logResponse(_ value: (data: Data, response: URLResponse), printJSON: Bool) { + guard let httpResponse = value.response as? HTTPURLResponse, + let url = httpResponse.url?.absoluteString, + let comps = URLComponents(string: url), + let host = comps.host + else { return } + + print("♻️ Incoming response from \(host) @ \(Date())") + + let statusCode = httpResponse.statusCode + let statusCodeString = HTTPURLResponse.localizedString(forStatusCode: statusCode) + let path = comps.path + + var printOutput = "~ \(path)\n" + printOutput += "Status-Code: \(statusCode)\n" + printOutput += "Localized Status-Code: \(statusCodeString)\n" + + httpResponse.allHeaderFields.forEach { key, value in + if key.description == HTTP.Header.Field.contentLength || key.description == HTTP.Header.Field.contentType { + printOutput += "\(key): \(value)\n" + } + } + + print(printOutput) + if printJSON { + print("JSON response:") + print(value.data.prettyPrinted ?? "") + } + } +} + +// MARK: - +private extension Data { + /// Convert data into an optional pretty printed json string. + var prettyPrinted: String? { + guard let object = try? JSONSerialization.jsonObject(with: self, options: []), + let data = try? JSONSerialization.data(withJSONObject: object, options: [.prettyPrinted]) + else { return nil } + return String(data: data, encoding: .utf8) + } } diff --git a/Networking-Example/Pods/Networking-Swift/Sources/Extensions/URLRequest.swift b/Networking-Example/Pods/Networking-Swift/Sources/Extensions/URLRequest.swift index 676c7d9..1a0f7d1 100644 --- a/Networking-Example/Pods/Networking-Swift/Sources/Extensions/URLRequest.swift +++ b/Networking-Example/Pods/Networking-Swift/Sources/Extensions/URLRequest.swift @@ -34,7 +34,11 @@ public extension URLRequest { /// Print outgoing request information to the console func log() { - guard let url = url?.absoluteString, let components = URLComponents(string: url), let method = httpMethod, let host = components.host else { return } + guard let url = url?.absoluteString, + let components = URLComponents(string: url), + let method = httpMethod, + let host = components.host + else { return } print("⚡️ Outgoing request to \(host) @ \(Date())") diff --git a/Networking-Example/Pods/Networking-Swift/Sources/ServerConfig/ServerConfig.swift b/Networking-Example/Pods/Networking-Swift/Sources/ServerConfig/ServerConfig.swift index 2e754cf..439c750 100644 --- a/Networking-Example/Pods/Networking-Swift/Sources/ServerConfig/ServerConfig.swift +++ b/Networking-Example/Pods/Networking-Swift/Sources/ServerConfig/ServerConfig.swift @@ -2,56 +2,93 @@ // ServerConfig.swift // Networking // -// Created by Viktor Gidlöf. +// Created by VG on 2024-11-13. // import Foundation -/// An object for creating a server configuration for the backend API -open class ServerConfig { +public protocol ServerConfigurable { + var baseURL: URL { get } + func header(forRequest request: Requestable) -> HTTP.Header +} +// MARK: - +public struct ServerConfig: ServerConfigurable { // MARK: Private properties - private let tokenProvider: TokenProvidable? + private let additionalHeaders: HTTP.Header // MARK: - Public properties + public let userAgent: String? + /// A provider for authorization tokens used to authenticate requests; `nil` if no authentication is needed. + public let tokenProvider: TokenProvidable? /// The base URL for the server public let baseURL: URL - /// Init the server configuration - /// - parameters: - /// - baseURL: The given base URL used for this server config - /// - tokenProvider: An optional token provider object used to authenticate requests. Defaults to `nil`. - public init(baseURL: String, tokenProvider: TokenProvidable? = nil) { - self.baseURL = baseURL.asURL() + // MARK: - Initialization + /// Initializes a new instance of `ServerConfigV2` with the specified configuration details. + /// - Parameters: + /// - baseURL: A `String` representing the base URL for the server. This URL will be used as the primary endpoint for all requests. + /// - userAgent: An optional `String` representing the user agent to include in the request headers. If not provided, it defaults to a string combining `name` and `version`. + /// - additionalHeaders: An optional dictionary of additional headers to be merged into the default headers for each request. The default value is an empty dictionary. + /// - tokenProvider: An optional `TokenProvidable` object used to authenticate requests. This provider supplies authorization tokens when required by a request. Defaults to `nil`, meaning no token is provided. + /// - Returns: A configured instance of `ServerConfigV2` with the specified parameters. + public init?( + baseURL: String, + userAgent: String? = "\(name)/\(version)", + additionalHeaders: HTTP.Header = [:], + tokenProvider: TokenProvidable? = nil + ) { + guard let url = baseURL.asURL() else { return nil } + self.baseURL = url + self.userAgent = userAgent + self.additionalHeaders = additionalHeaders self.tokenProvider = tokenProvider } +} - /// Create a HTTP header for the requests. - /// Subclasses can call `super` if they need to implement the standard authentication. - /// Don't call `super` if you want to have a fully custom HTTP header implementation. - /// - parameter request: The given request to set up the header with - /// - returns: A new `HTTP.Header` dictionary - open func header(forRequest request: Requestable) -> HTTP.Header { - var header = HTTP.Header() - header[HTTP.Header.Field.userAgent] = "\(name)/\(version)" - header[HTTP.Header.Field.host] = baseURL.host - - if let contentType = request.contentType { - header[HTTP.Header.Field.contentType] = contentType - } +// MARK: - Public functions +public extension ServerConfig { + func header(forRequest request: Requestable) -> HTTP.Header { + var headers = HTTP.Header() + + // Base headers + if let host = baseURL.host { headers[HTTP.Header.Field.host] = host } + if let userAgent = userAgent { headers[HTTP.Header.Field.userAgent] = userAgent } + if let contentType = request.contentType { headers[HTTP.Header.Field.contentType] = contentType } - guard let tokenProvider = tokenProvider else { return header } + // Add any additional configured headers + headers.merge(additionalHeaders) { _, new in new } + + guard let tokenProvider else { return headers } switch tokenProvider.token { case .success(let token): - switch request.authorization { - case .bearer: header[HTTP.Header.Field.auth] = String(format: HTTP.Header.Field.bearer, token) - case .basic: header[HTTP.Header.Field.auth] = String(format: HTTP.Header.Field.basic, token) - case .none: break - } - case .failure: - break + guard let authHeader = authorizationHeader(for: request.authorization, token: token) else { break } + headers[HTTP.Header.Field.auth] = authHeader + case .failure: break + } + return headers + } +} + +// MARK: - Convenience Initializers +public extension ServerConfig { + static func basic(baseURL: String) -> ServerConfig? { + .init(baseURL: baseURL) + } + + static func authenticated(baseURL: String, tokenProvider: TokenProvidable) -> ServerConfig? { + .init(baseURL: baseURL, tokenProvider: tokenProvider) + } +} + +// MARK: - Private functions +private extension ServerConfig { + func authorizationHeader(for type: Request.Authorization, token: String) -> String? { + switch type { + case .bearer: return String(format: HTTP.Header.Field.bearer, token) + case .basic: return String(format: HTTP.Header.Field.basic, token) + case .none: return nil } - return header } } diff --git a/Networking-Example/Pods/Networking-Swift/Sources/Service/DownloadPublisher.swift b/Networking-Example/Pods/Networking-Swift/Sources/Service/DownloadPublisher.swift deleted file mode 100644 index 8e39d14..0000000 --- a/Networking-Example/Pods/Networking-Swift/Sources/Service/DownloadPublisher.swift +++ /dev/null @@ -1,101 +0,0 @@ -// -// DownloadPublisher.swift -// Networking -// -// Created by Viktor Gidlöf. -// - -import Foundation -import Combine - -public extension Network.Service { - /// A downloader structure object used to track and progress file downloads - struct Downloader: Publisher { - public typealias Failure = Error - - // MARK: Private properties - private let url: URL - - // MARK: - Public properties - /// The publisher output - public enum Output { - /// The destination case containing the temporary file destination - case destination(URL) - /// The progress case containing the download progress as a `Float` value - case progress(Float) - } - - // MARK: - Init - /// Initialize the download publisher - /// - parameter url: The given file URL - init(url: URL) { - self.url = url - } - - // MARK: - Public functions - public func receive(subscriber: S) where Output == S.Input, Failure == S.Failure { - let subscription = DownloadSubscription(subscriber, url: url) - subscriber.receive(subscription: subscription) - } - } -} - -// MARK: - -private extension Network.Service { - - /// A subscriber object that conforms to `URLSessionDownloadDelegate` used to report and track URL session downloads - private final class DownloadSubscription: Network.Service.Sub, URLSessionDownloadDelegate where S.Input == Downloader.Output, S.Failure == Error { - // MARK: Private properties - private var session: URLSession! - private let url: URL - - // MARK: - Init - /// Init the subscriber - /// - parameters: - /// - subscriber: The given subscriber - /// - url: The URL to the file to download - init(_ subscriber: S, url: URL) { - self.url = url - super.init(subscriber: subscriber) - - session = URLSession(configuration: .default, delegate: self, delegateQueue: .main) - session.downloadTask(with: url).resume() - _ = subscriber.receive(.progress(0.0)) - } - - // MARK: - URLSessionDownloadDelegate - func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) { - let progress = Float(totalBytesWritten) / Float(totalBytesExpectedToWrite) - _ = subscriber?.receive(.progress(progress)) - } - - func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) { - _ = subscriber?.receive(.destination(location)) - subscriber?.receive(completion: .finished) - } - - func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) { - guard let error = error else { return } - subscriber?.receive(completion: .failure(error)) - } - } -} - -// MARK: - -private extension Network.Service { - /// A custom subscriber object used for creating subscriptions - class Sub: NSObject, Subscription { - // MARK: Private properties - private(set) var subscriber: S? - - // MARK: - Init - init(subscriber: S) { - self.subscriber = subscriber - super.init() - } - - // MARK: - Public functions - func request(_ demand: Subscribers.Demand) {} - func cancel() { subscriber = nil } - } -} diff --git a/Networking-Example/Pods/Networking-Swift/Sources/Service/Downloader.swift b/Networking-Example/Pods/Networking-Swift/Sources/Service/Downloader.swift new file mode 100644 index 0000000..8dfb9eb --- /dev/null +++ b/Networking-Example/Pods/Networking-Swift/Sources/Service/Downloader.swift @@ -0,0 +1,99 @@ +// +// DownloadPublisher.swift +// Networking +// +// Created by Viktor Gidlöf. +// + +import Foundation + +public extension Network.Service { + /// A downloader actor that handles file downloads with progress tracking + actor Downloader { + // MARK: Private properties + private let url: URL + private var downloadTask: URLSessionDownloadTask? + private var progressContinuation: AsyncStream.Continuation? + + // MARK: - Init + init(url: URL) { + self.url = url + } + } +} + +// MARK: - Public functions +public extension Network.Service.Downloader { + /// Start downloading the file and track progress + /// - Returns: A tuple containing the downloaded file URL and an AsyncStream of progress updates + func download() async throws -> (URL, AsyncStream) { + let (stream, continuation) = AsyncStream.makeStream() + progressContinuation = continuation + continuation.yield(0.0) + + let downloadedURL = try await withCheckedThrowingContinuation { continuation in + let delegate = DownloadDelegate { [weak self] result in + Task { [weak self] in + await self?.handleCompletion(result, continuation: continuation) + } + } progressHandler: { [weak self] progress in + Task { [weak self] in + await self?.handleProgress(progress) + } + } + let session = URLSession(configuration: .default, delegate: delegate, delegateQueue: nil) + let task = session.downloadTask(with: url) + downloadTask = task + task.resume() + } + return (downloadedURL, stream) + } + + /// Cancel the ongoing download + func cancel() { + downloadTask?.cancel() + progressContinuation?.finish() + } +} + +// MARK: - Private functions +private extension Network.Service.Downloader { + func handleCompletion(_ result: Result, continuation: CheckedContinuation) { + switch result { + case .success(let url): continuation.resume(returning: url) + case .failure(let error): continuation.resume(throwing: error) + } + progressContinuation?.finish() + } + + func handleProgress(_ progress: Float) { + progressContinuation?.yield(progress) + } +} + +// MARK: - Download Delegate +private final class DownloadDelegate: NSObject, URLSessionDownloadDelegate { + private let completionHandler: (Result) -> Void + private let progressHandler: (Float) -> Void + + init(completionHandler: @escaping (Result) -> Void, progressHandler: @escaping (Float) -> Void) { + self.completionHandler = completionHandler + self.progressHandler = progressHandler + super.init() + } + + func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) { + completionHandler(.success(location)) + } + + func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) { + let progress = Float(totalBytesWritten) / Float(totalBytesExpectedToWrite) + progressHandler(progress) + } + + func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) { + if let error = error { + completionHandler(.failure(error)) + } + } +} diff --git a/Networking-Example/Pods/Networking-Swift/Sources/Service/NetworkService.swift b/Networking-Example/Pods/Networking-Swift/Sources/Service/NetworkService.swift index 79caf30..f1a8cd0 100644 --- a/Networking-Example/Pods/Networking-Swift/Sources/Service/NetworkService.swift +++ b/Networking-Example/Pods/Networking-Swift/Sources/Service/NetworkService.swift @@ -9,7 +9,7 @@ import Foundation import Combine public let name = "Networking" -public let version = "0.8.9" +public let version = "0.9.0" public enum Network { /// A network service object used to make requests to the backend. @@ -30,65 +30,61 @@ public enum Network { self.decoder = decoder self.server = server } - - // MARK: - Private functions - private func dataTaskPublisher(_ request: Requestable, logResponse: Bool) throws -> AnyPublisher { - let config = Request.Config(request: request, server: server) - let urlRequest = try URLRequest(withConfig: config) - urlRequest.log() - - return session.dataTaskPublisher(for: urlRequest) - .logResponse(printJSON: logResponse) - .receive(on: RunLoop.main) - .tryMap { $0 } - .eraseToAnyPublisher() - } } } -// MARK: - +// MARK: - Public functions public extension Network.Service { - /// Create a new publisher that contains a decoded data model object + /// Send a request and decode the response into a data model object /// - parameters: /// - request: The request to send over the network /// - logResponse: A boolean value that determines if the json response should be printed to the console. Defaults to false. - /// - throws: An error if the data task publisher fails for any reason - /// - returns: A new publisher with the given data model object or an error - func request(_ request: Requestable, logResponse: Bool = false) throws -> AnyPublisher { - try dataPublisher(request, logResponse: logResponse) - .decode(type: DataModel.self, decoder: decoder) - .eraseToAnyPublisher() + /// - throws: An error if the request fails for any reason + /// - returns: The decoded data model object + func request(_ request: Requestable, logResponse: Bool = false) async throws -> DataModel { + let (data, _) = try await makeDataRequest(request, logResponse: logResponse) + return try decoder.decode(DataModel.self, from: data) } - /// Create a new publisher that contains the response data + /// Send a request and return the raw response data /// - parameters: /// - request: The request to send over the network /// - logResponse: A boolean value that determines if the json response should be printed to the console. Defaults to false. - /// - throws: An error if the data task publisher fails for any reason - /// - returns: A new publisher with the data or an error - func dataPublisher(_ request: Requestable, logResponse: Bool = false) throws -> AnyPublisher { - try dataTaskPublisher(request, logResponse: logResponse) - .map(\.data) - .eraseToAnyPublisher() + /// - throws: An error if the request fails for any reason + /// - returns: The raw response data + func data(_ request: Requestable, logResponse: Bool = false) async throws -> Data { + let (data, _) = try await makeDataRequest(request, logResponse: logResponse) + return data } - /// Create a new publisher that contains the HTTP status code + /// Send a request and return the HTTP status code /// - parameters: /// - request: The request to send over the network /// - logResponse: A boolean value that determines if the json response should be printed to the console. Defaults to false. - /// - throws: An error if the data task publisher fails for any reason - /// - returns: A new publisher with a bool value that determines if the request succeeded - func responsePublisher(_ request: Requestable, logResponse: Bool = false) throws -> AnyPublisher { - try dataTaskPublisher(request, logResponse: logResponse) - .compactMap { $0.response as? HTTPURLResponse } - .map { HTTP.StatusCode(rawValue: $0.statusCode) ?? .unknown } - .eraseToAnyPublisher() + /// - throws: An error if the request fails for any reason + /// - returns: The HTTP status code + func response(_ request: Requestable, logResponse: Bool = false) async throws -> HTTP.StatusCode { + let (_, response) = try await makeDataRequest(request, logResponse: logResponse) + guard let httpResponse = response as? HTTPURLResponse else { return .unknown } + return HTTP.StatusCode(rawValue: httpResponse.statusCode) ?? .unknown } - /// Create a new publisher that publishes file download progress and the destination of the temporary file - /// - parameter url: The URL to the file to download - /// - returns: A new download publisher with the file download progress and destination URL - func downloadPublisher(url: URL) -> Network.Service.Downloader { + /// Creates a new instance of `Network.Service.Downloader` configured with the specified URL. + /// - Parameter url: The `URL` from which the downloader will retrieve data. + /// - Returns: A configured `Network.Service.Downloader` instance for downloading data from the given URL. + func downloader(url: URL) -> Network.Service.Downloader { Network.Service.Downloader(url: url) } } + +// MARK: - Private functions +private extension Network.Service { + func makeDataRequest(_ request: Requestable, logResponse: Bool) async throws -> (Data, URLResponse) { + let urlRequest = try request.configure(withServer: server) + let (data, response) = try await session.data(for: urlRequest) + if logResponse { + String.logResponse((data, response), printJSON: logResponse) + } + return (data, response) + } +} diff --git a/Networking-Example/Pods/Pods.xcodeproj/project.pbxproj b/Networking-Example/Pods/Pods.xcodeproj/project.pbxproj index 086c846..e6d6db9 100644 --- a/Networking-Example/Pods/Pods.xcodeproj/project.pbxproj +++ b/Networking-Example/Pods/Pods.xcodeproj/project.pbxproj @@ -7,33 +7,32 @@ objects = { /* Begin PBXBuildFile section */ - 019F7A0350EEEAB1A11A32C5120F0419 /* EndpointType.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA5AD873485347EB4B36C620ECCD885F /* EndpointType.swift */; }; - 038091E4D70DCFEFC96F55BBE7851CCB /* Publisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FF441F7F4C01123BD5ABD29F1002592 /* Publisher.swift */; }; - 1C21D14C68262006616892EF2A03FA3C /* RequestConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DBA75A31100CA78D6A4D2C66774CF5E /* RequestConfig.swift */; }; - 2614DDD084892D5C6424C8A14503A6FC /* HTTP.swift in Sources */ = {isa = PBXBuildFile; fileRef = 142CAD9043082847A3C8F9002C4DC123 /* HTTP.swift */; }; - 2ACC27A579CE0687B4B4BABFBD195419 /* URLRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD55CE40F96358B49C709A29D4F96A90 /* URLRequest.swift */; }; - 319821ED03EB28985A1D017797D1811B /* StatusCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42308E2EE3F8F5ADD93CC1E4E079F314 /* StatusCode.swift */; }; - 4594770555F7A7EBB4A4A76B463E350A /* TokenProvidable.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4FDE3BD828985B80C9C6BC35FB5184D /* TokenProvidable.swift */; }; + 007DCF26675B733B9D7DE1EF5CB2BED7 /* Requestable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1CB44F721D7E3A9B1C37FEB1C50F526 /* Requestable.swift */; }; + 08D5323379488F28320E54EB91510313 /* Networking-Swift-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 4075C6E885A322613A654A72B21A3D19 /* Networking-Swift-dummy.m */; }; + 0E694246C2CCEE012935AF843958F2C3 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73010CC983E3809BECEE5348DA1BB8C6 /* Foundation.framework */; }; + 1F2BA4256210FFF3228872320C109849 /* ServerConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = CF2255AF57C26E7EEF746A0DD7D623A9 /* ServerConfig.swift */; }; + 2F23A4AFC53239B37F625AC54043B70A /* Networking-Swift-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4B4CAC00C579463291A5F379F45226 /* Networking-Swift-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3116CC76DD3A96E38078A8D861D293C4 /* Encodable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27AA25AA8C787F69FD8342A2C10892CB /* Encodable.swift */; }; + 32FAEC52A2CC18F830C4CD380648888E /* RequestConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9B4142D0B1C6E95C772D54ED46D2108 /* RequestConfig.swift */; }; 47B9999030EE3E4B0A42402A5295085D /* Pods-Networking-Example-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = EC90EEB1FBE61E13B4E172B6835BDFF5 /* Pods-Networking-Example-dummy.m */; }; - 647D72B4664B7131AC989278D511A460 /* Networking-Swift-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = F12ADBDF679D658D62E0278EFEC067BB /* Networking-Swift-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 71D1482BCCBAF39E69578A0376AFB60D /* DownloadPublisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E3B57AF1B918AA24D302789EF448060 /* DownloadPublisher.swift */; }; - 863974EB459CE68B8DC821F7E2723D9F /* Networking-Swift-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 3017EB4282DBD39DCF63DD89C5A0D6F4 /* Networking-Swift-dummy.m */; }; - 89B22F61A099049FC3856642ACFD2E15 /* Requestable.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB2CAB9517A97473E047893ADEC58C8D /* Requestable.swift */; }; - 8E7E328E2CAD37000C5B775F744D309F /* Header.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C54DE1A71B487E452D9A69FCEDA4A5B /* Header.swift */; }; + 50B1C221F1866198BD752348DD1C1EFB /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B21ED7F91BE3D0F682EFCEA92B26F5F /* Request.swift */; }; + 7F0A5387922C0767C62E690FC442D8F6 /* URL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 496BDCDB64EC5C1A2B1AD3ADD2F12155 /* URL.swift */; }; + 83A8D4E502E80B2B89F3E25DF604D294 /* NetworkService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DFA39EBD1D9FE8DBF0441CE0EFBB597 /* NetworkService.swift */; }; + 83AED815F02A7C717B6CC9FE3BB8D0CF /* TokenProvidable.swift in Sources */ = {isa = PBXBuildFile; fileRef = B729E7A9A201977F0081536B7F3AD163 /* TokenProvidable.swift */; }; 9180563A991AAA092CA60241EBCB5299 /* Pods-Networking-Example-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 765A5DADDB6E12D78E6C6D1B2848AC05 /* Pods-Networking-Example-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 93E53DDE6196F2128A0298AC8ECBF4E6 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75BDB5B8520A0B541A7F5515863529F /* Request.swift */; }; - 999A79FE2004E7E16120A611463DF60D /* NetworkService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C5F03A8C3E5FB2C36BF7202DF2E90C2 /* NetworkService.swift */; }; - 9CDA7CA194896CAFCA63E473509BF3DC /* DataTaskPublisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8C83F4053CE1140284CC00E9F3B3EB2B /* DataTaskPublisher.swift */; }; - A5D4643885F5116699E20CB27CFFF8A9 /* URL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EB710A4F284107B5E5456B67CC72206 /* URL.swift */; }; - A646A498ACC65A172D312A0A2F25164B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73010CC983E3809BECEE5348DA1BB8C6 /* Foundation.framework */; }; + 930F9BC5D0633214D99D2F27B10ED666 /* EndpointType.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7518099D80269C5A8D814011EE2AA38 /* EndpointType.swift */; }; + 965A7B733370CB8F64895273360C2B08 /* Header.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15D8913CBE572C4F36ABC06C9639A6FB /* Header.swift */; }; + A06B852DBD18C3A1C875702DF2B61BF7 /* URLRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29371DA5DAD105DC4AC32C5C3D535438 /* URLRequest.swift */; }; + AC6E207ED31AE3F24159F7269155AD5F /* Publisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6141852F542D0578767B85E08D391638 /* Publisher.swift */; }; + B4BDDDBD5783FBE0C50F40F17574933A /* String.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E62C0A7681E75210BFE6ACC2959EAE0 /* String.swift */; }; + C48CBA664A7E299CBB4528F1B552EBDA /* StatusCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9592381B7BE30E03863364FAA67793C /* StatusCode.swift */; }; + D79287819DA2CAC2820B5904AD58C2A7 /* Downloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 112373AD723696D367A76D2A08D99E29 /* Downloader.swift */; }; E4DB2D41C70A5288D5FE60D82E99D95E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73010CC983E3809BECEE5348DA1BB8C6 /* Foundation.framework */; }; - F295DB8AC15F68BE94B2D24673A4609F /* Encodable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96402FB58CBEAD70DAD474FC8D082692 /* Encodable.swift */; }; - F77217FFAF586CA50195D6D62EA3DFA6 /* String.swift in Sources */ = {isa = PBXBuildFile; fileRef = 060DC6288850E4D8A4D860529FE8B329 /* String.swift */; }; - FFE71A14B639452954269AF6D3A1BAAF /* ServerConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2B21734BE5463203097D37E4856E1CC0 /* ServerConfig.swift */; }; + FD28D0E2B646887999539832A279FB9C /* HTTP.swift in Sources */ = {isa = PBXBuildFile; fileRef = 079704136D607BAA2E84755217DEB6B0 /* HTTP.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - BD3E8A5D10B1B9C9E7C960C65D6E56BD /* PBXContainerItemProxy */ = { + 69AA98D9FEBCBEC8A858B3C2D287E547 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; proxyType = 1; @@ -43,43 +42,42 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 0353E74C69058F2ACC36E07C94455C06 /* Networking-Swift.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Networking-Swift.modulemap"; sourceTree = ""; }; - 060DC6288850E4D8A4D860529FE8B329 /* String.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = String.swift; path = Sources/Extensions/String.swift; sourceTree = ""; }; + 079704136D607BAA2E84755217DEB6B0 /* HTTP.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HTTP.swift; path = Sources/HTTP/HTTP.swift; sourceTree = ""; }; + 0DFA39EBD1D9FE8DBF0441CE0EFBB597 /* NetworkService.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NetworkService.swift; path = Sources/Service/NetworkService.swift; sourceTree = ""; }; 0E0E380EDC26F9CC6FA750FEA3DFCCD1 /* Pods-Networking-Example-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-Networking-Example-acknowledgements.plist"; sourceTree = ""; }; - 142CAD9043082847A3C8F9002C4DC123 /* HTTP.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HTTP.swift; path = Sources/HTTP/HTTP.swift; sourceTree = ""; }; + 112373AD723696D367A76D2A08D99E29 /* Downloader.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Downloader.swift; path = Sources/Service/Downloader.swift; sourceTree = ""; }; + 15D8913CBE572C4F36ABC06C9639A6FB /* Header.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Header.swift; path = Sources/HTTP/Header.swift; sourceTree = ""; }; 20FC92355A6BDDF5D906C13CF33FC847 /* Pods-Networking-Example-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-Networking-Example-Info.plist"; sourceTree = ""; }; - 2B21734BE5463203097D37E4856E1CC0 /* ServerConfig.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServerConfig.swift; path = Sources/ServerConfig/ServerConfig.swift; sourceTree = ""; }; - 2ECA793B3E070633C656D37899B85825 /* Networking-Swift.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Networking-Swift.debug.xcconfig"; sourceTree = ""; }; - 2FF441F7F4C01123BD5ABD29F1002592 /* Publisher.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Publisher.swift; path = Sources/Extensions/Publisher.swift; sourceTree = ""; }; - 3017EB4282DBD39DCF63DD89C5A0D6F4 /* Networking-Swift-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Networking-Swift-dummy.m"; sourceTree = ""; }; - 3C5F03A8C3E5FB2C36BF7202DF2E90C2 /* NetworkService.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NetworkService.swift; path = Sources/Service/NetworkService.swift; sourceTree = ""; }; - 3E3B57AF1B918AA24D302789EF448060 /* DownloadPublisher.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DownloadPublisher.swift; path = Sources/Service/DownloadPublisher.swift; sourceTree = ""; }; + 27AA25AA8C787F69FD8342A2C10892CB /* Encodable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Encodable.swift; path = Sources/Extensions/Encodable.swift; sourceTree = ""; }; + 29371DA5DAD105DC4AC32C5C3D535438 /* URLRequest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = URLRequest.swift; path = Sources/Extensions/URLRequest.swift; sourceTree = ""; }; + 37573F36218C4DACE091C774F7D36934 /* Networking-Swift.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Networking-Swift.debug.xcconfig"; sourceTree = ""; }; 3E56A0808F3B245A8DFAB5C94710870F /* Pods-Networking-Example */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = "Pods-Networking-Example"; path = Pods_Networking_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 42308E2EE3F8F5ADD93CC1E4E079F314 /* StatusCode.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = StatusCode.swift; path = Sources/HTTP/StatusCode.swift; sourceTree = ""; }; - 4EB710A4F284107B5E5456B67CC72206 /* URL.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = URL.swift; path = Sources/Extensions/URL.swift; sourceTree = ""; }; - 5BE9AFA7AE5FE9F1A8B5F283F626D651 /* Networking-Swift.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Networking-Swift.release.xcconfig"; sourceTree = ""; }; - 5DBA75A31100CA78D6A4D2C66774CF5E /* RequestConfig.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RequestConfig.swift; path = Sources/Requests/RequestConfig.swift; sourceTree = ""; }; + 4075C6E885A322613A654A72B21A3D19 /* Networking-Swift-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Networking-Swift-dummy.m"; sourceTree = ""; }; + 496BDCDB64EC5C1A2B1AD3ADD2F12155 /* URL.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = URL.swift; path = Sources/Extensions/URL.swift; sourceTree = ""; }; + 4E62C0A7681E75210BFE6ACC2959EAE0 /* String.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = String.swift; path = Sources/Extensions/String.swift; sourceTree = ""; }; + 5A4BD780D66154F4DD22F7FEA467CB5A /* Networking-Swift.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Networking-Swift.release.xcconfig"; sourceTree = ""; }; + 6141852F542D0578767B85E08D391638 /* Publisher.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Publisher.swift; path = Sources/Extensions/Publisher.swift; sourceTree = ""; }; + 6B21ED7F91BE3D0F682EFCEA92B26F5F /* Request.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Request.swift; path = Sources/Requests/Request.swift; sourceTree = ""; }; 6F3E4321EFD72C26D8A484894FD97681 /* Pods-Networking-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Networking-Example.debug.xcconfig"; sourceTree = ""; }; 73010CC983E3809BECEE5348DA1BB8C6 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; 765A5DADDB6E12D78E6C6D1B2848AC05 /* Pods-Networking-Example-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-Networking-Example-umbrella.h"; sourceTree = ""; }; 76F559E69080B8C219C5F8D841A03ED7 /* Pods-Networking-Example-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-Networking-Example-frameworks.sh"; sourceTree = ""; }; + 7E4B4CAC00C579463291A5F379F45226 /* Networking-Swift-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Networking-Swift-umbrella.h"; sourceTree = ""; }; 80EF5F25B8535B091475C56DE659CAC9 /* Pods-Networking-Example.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-Networking-Example.modulemap"; sourceTree = ""; }; 8400D97130A6AB39782C20135E187275 /* Networking-Swift */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = "Networking-Swift"; path = Networking_Swift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 84C0AF1F6EF557DE07F2EE077C818845 /* Networking-Swift-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Networking-Swift-prefix.pch"; sourceTree = ""; }; 8931EEB6300F37C7EF84F512A88E8642 /* Pods-Networking-Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-Networking-Example-acknowledgements.markdown"; sourceTree = ""; }; - 8C83F4053CE1140284CC00E9F3B3EB2B /* DataTaskPublisher.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DataTaskPublisher.swift; path = Sources/Extensions/DataTaskPublisher.swift; sourceTree = ""; }; - 96402FB58CBEAD70DAD474FC8D082692 /* Encodable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Encodable.swift; path = Sources/Extensions/Encodable.swift; sourceTree = ""; }; - 9C54DE1A71B487E452D9A69FCEDA4A5B /* Header.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Header.swift; path = Sources/HTTP/Header.swift; sourceTree = ""; }; + 976EF1F971DB9955C1B81937593BB85E /* Networking-Swift.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Networking-Swift.modulemap"; sourceTree = ""; }; 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - A92DC8567996B837B93B5D93E48C34FA /* Networking-Swift-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Networking-Swift-Info.plist"; sourceTree = ""; }; - AD55CE40F96358B49C709A29D4F96A90 /* URLRequest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = URLRequest.swift; path = Sources/Extensions/URLRequest.swift; sourceTree = ""; }; - B4FDE3BD828985B80C9C6BC35FB5184D /* TokenProvidable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TokenProvidable.swift; path = Sources/Protocols/TokenProvidable.swift; sourceTree = ""; }; - D607B7799CDC7E8288B2DC2D7C72D9D3 /* Networking-Swift-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Networking-Swift-prefix.pch"; sourceTree = ""; }; - DB2CAB9517A97473E047893ADEC58C8D /* Requestable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Requestable.swift; path = Sources/Protocols/Requestable.swift; sourceTree = ""; }; + A9B4142D0B1C6E95C772D54ED46D2108 /* RequestConfig.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RequestConfig.swift; path = Sources/Requests/RequestConfig.swift; sourceTree = ""; }; + B729E7A9A201977F0081536B7F3AD163 /* TokenProvidable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TokenProvidable.swift; path = Sources/Protocols/TokenProvidable.swift; sourceTree = ""; }; + C5C1CB6EA100DC9F616DAEEE3381C92D /* Networking-Swift-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Networking-Swift-Info.plist"; sourceTree = ""; }; + CF2255AF57C26E7EEF746A0DD7D623A9 /* ServerConfig.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServerConfig.swift; path = Sources/ServerConfig/ServerConfig.swift; sourceTree = ""; }; + D1CB44F721D7E3A9B1C37FEB1C50F526 /* Requestable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Requestable.swift; path = Sources/Protocols/Requestable.swift; sourceTree = ""; }; + D7518099D80269C5A8D814011EE2AA38 /* EndpointType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = EndpointType.swift; path = Sources/Protocols/EndpointType.swift; sourceTree = ""; }; E76EF03CE12138874AC55F6B0B5A9F39 /* Pods-Networking-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Networking-Example.release.xcconfig"; sourceTree = ""; }; EC90EEB1FBE61E13B4E172B6835BDFF5 /* Pods-Networking-Example-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-Networking-Example-dummy.m"; sourceTree = ""; }; - F12ADBDF679D658D62E0278EFEC067BB /* Networking-Swift-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Networking-Swift-umbrella.h"; sourceTree = ""; }; - F75BDB5B8520A0B541A7F5515863529F /* Request.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Request.swift; path = Sources/Requests/Request.swift; sourceTree = ""; }; - FA5AD873485347EB4B36C620ECCD885F /* EndpointType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = EndpointType.swift; path = Sources/Protocols/EndpointType.swift; sourceTree = ""; }; + F9592381B7BE30E03863364FAA67793C /* StatusCode.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = StatusCode.swift; path = Sources/HTTP/StatusCode.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -91,17 +89,50 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - F50D65DB4E954A05188C4DA2E5F328AD /* Frameworks */ = { + D68FC490C4574FCA3512CBAE2409A70A /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A646A498ACC65A172D312A0A2F25164B /* Foundation.framework in Frameworks */, + 0E694246C2CCEE012935AF843958F2C3 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 1A157887650637DD1CAAFBF1D65039FE /* Pods */ = { + isa = PBXGroup; + children = ( + 2B3033FCA3E4DB9CA07E2F87C3BC1C2F /* Networking-Swift */, + ); + name = Pods; + sourceTree = ""; + }; + 2B3033FCA3E4DB9CA07E2F87C3BC1C2F /* Networking-Swift */ = { + isa = PBXGroup; + children = ( + 112373AD723696D367A76D2A08D99E29 /* Downloader.swift */, + 27AA25AA8C787F69FD8342A2C10892CB /* Encodable.swift */, + D7518099D80269C5A8D814011EE2AA38 /* EndpointType.swift */, + 15D8913CBE572C4F36ABC06C9639A6FB /* Header.swift */, + 079704136D607BAA2E84755217DEB6B0 /* HTTP.swift */, + 0DFA39EBD1D9FE8DBF0441CE0EFBB597 /* NetworkService.swift */, + 6141852F542D0578767B85E08D391638 /* Publisher.swift */, + 6B21ED7F91BE3D0F682EFCEA92B26F5F /* Request.swift */, + D1CB44F721D7E3A9B1C37FEB1C50F526 /* Requestable.swift */, + A9B4142D0B1C6E95C772D54ED46D2108 /* RequestConfig.swift */, + CF2255AF57C26E7EEF746A0DD7D623A9 /* ServerConfig.swift */, + F9592381B7BE30E03863364FAA67793C /* StatusCode.swift */, + 4E62C0A7681E75210BFE6ACC2959EAE0 /* String.swift */, + B729E7A9A201977F0081536B7F3AD163 /* TokenProvidable.swift */, + 496BDCDB64EC5C1A2B1AD3ADD2F12155 /* URL.swift */, + 29371DA5DAD105DC4AC32C5C3D535438 /* URLRequest.swift */, + 9F3EF0054AC3E4A8CA05CD031603C442 /* Support Files */, + ); + name = "Networking-Swift"; + path = "Networking-Swift"; + sourceTree = ""; + }; 578452D2E740E91742655AC8F1636D1F /* iOS */ = { isa = PBXGroup; children = ( @@ -118,38 +149,19 @@ name = "Targets Support Files"; sourceTree = ""; }; - AFF71F5EDB193E0E8686FAB0C6BB50A3 /* Networking-Swift */ = { + 9F3EF0054AC3E4A8CA05CD031603C442 /* Support Files */ = { isa = PBXGroup; children = ( - 8C83F4053CE1140284CC00E9F3B3EB2B /* DataTaskPublisher.swift */, - 3E3B57AF1B918AA24D302789EF448060 /* DownloadPublisher.swift */, - 96402FB58CBEAD70DAD474FC8D082692 /* Encodable.swift */, - FA5AD873485347EB4B36C620ECCD885F /* EndpointType.swift */, - 9C54DE1A71B487E452D9A69FCEDA4A5B /* Header.swift */, - 142CAD9043082847A3C8F9002C4DC123 /* HTTP.swift */, - 3C5F03A8C3E5FB2C36BF7202DF2E90C2 /* NetworkService.swift */, - 2FF441F7F4C01123BD5ABD29F1002592 /* Publisher.swift */, - F75BDB5B8520A0B541A7F5515863529F /* Request.swift */, - DB2CAB9517A97473E047893ADEC58C8D /* Requestable.swift */, - 5DBA75A31100CA78D6A4D2C66774CF5E /* RequestConfig.swift */, - 2B21734BE5463203097D37E4856E1CC0 /* ServerConfig.swift */, - 42308E2EE3F8F5ADD93CC1E4E079F314 /* StatusCode.swift */, - 060DC6288850E4D8A4D860529FE8B329 /* String.swift */, - B4FDE3BD828985B80C9C6BC35FB5184D /* TokenProvidable.swift */, - 4EB710A4F284107B5E5456B67CC72206 /* URL.swift */, - AD55CE40F96358B49C709A29D4F96A90 /* URLRequest.swift */, - D2612B1BF94A18CC612CBA449299CC51 /* Support Files */, + 976EF1F971DB9955C1B81937593BB85E /* Networking-Swift.modulemap */, + 4075C6E885A322613A654A72B21A3D19 /* Networking-Swift-dummy.m */, + C5C1CB6EA100DC9F616DAEEE3381C92D /* Networking-Swift-Info.plist */, + 84C0AF1F6EF557DE07F2EE077C818845 /* Networking-Swift-prefix.pch */, + 7E4B4CAC00C579463291A5F379F45226 /* Networking-Swift-umbrella.h */, + 37573F36218C4DACE091C774F7D36934 /* Networking-Swift.debug.xcconfig */, + 5A4BD780D66154F4DD22F7FEA467CB5A /* Networking-Swift.release.xcconfig */, ); - name = "Networking-Swift"; - path = "Networking-Swift"; - sourceTree = ""; - }; - B7E62BE8B363CA126444B57613D6573E /* Pods */ = { - isa = PBXGroup; - children = ( - AFF71F5EDB193E0E8686FAB0C6BB50A3 /* Networking-Swift */, - ); - name = Pods; + name = "Support Files"; + path = "../Target Support Files/Networking-Swift"; sourceTree = ""; }; C80DF5F2B7F30D20A4C814FCEF40CF89 /* Pods-Networking-Example */ = { @@ -174,7 +186,7 @@ children = ( 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */, D210D550F4EA176C3123ED886F8F87F5 /* Frameworks */, - B7E62BE8B363CA126444B57613D6573E /* Pods */, + 1A157887650637DD1CAAFBF1D65039FE /* Pods */, F075B6EE478CA61A0712889E93206EB2 /* Products */, 6F69A0A81DE200B7AE48E9BABBAB9A63 /* Targets Support Files */, ); @@ -188,21 +200,6 @@ name = Frameworks; sourceTree = ""; }; - D2612B1BF94A18CC612CBA449299CC51 /* Support Files */ = { - isa = PBXGroup; - children = ( - 0353E74C69058F2ACC36E07C94455C06 /* Networking-Swift.modulemap */, - 3017EB4282DBD39DCF63DD89C5A0D6F4 /* Networking-Swift-dummy.m */, - A92DC8567996B837B93B5D93E48C34FA /* Networking-Swift-Info.plist */, - D607B7799CDC7E8288B2DC2D7C72D9D3 /* Networking-Swift-prefix.pch */, - F12ADBDF679D658D62E0278EFEC067BB /* Networking-Swift-umbrella.h */, - 2ECA793B3E070633C656D37899B85825 /* Networking-Swift.debug.xcconfig */, - 5BE9AFA7AE5FE9F1A8B5F283F626D651 /* Networking-Swift.release.xcconfig */, - ); - name = "Support Files"; - path = "../Target Support Files/Networking-Swift"; - sourceTree = ""; - }; F075B6EE478CA61A0712889E93206EB2 /* Products */ = { isa = PBXGroup; children = ( @@ -215,19 +212,19 @@ /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ - 1ADC35FB7F3D9F5B7438313F60453F28 /* Headers */ = { + 2DAA8AEC0B992AFD64C261B0057C00AC /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 647D72B4664B7131AC989278D511A460 /* Networking-Swift-umbrella.h in Headers */, + 9180563A991AAA092CA60241EBCB5299 /* Pods-Networking-Example-umbrella.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; - 2DAA8AEC0B992AFD64C261B0057C00AC /* Headers */ = { + 828072279785568C99D718D9BE447138 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 9180563A991AAA092CA60241EBCB5299 /* Pods-Networking-Example-umbrella.h in Headers */, + 2F23A4AFC53239B37F625AC54043B70A /* Networking-Swift-umbrella.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -236,12 +233,12 @@ /* Begin PBXNativeTarget section */ 3BB699068123F93F580B5B337163BBDE /* Networking-Swift */ = { isa = PBXNativeTarget; - buildConfigurationList = AB59D86DF6E5E5040629B1AB95FD4569 /* Build configuration list for PBXNativeTarget "Networking-Swift" */; + buildConfigurationList = 8D4C8652D7B44240E2431DB02FCC1B46 /* Build configuration list for PBXNativeTarget "Networking-Swift" */; buildPhases = ( - 1ADC35FB7F3D9F5B7438313F60453F28 /* Headers */, - F1C6409B0EC3FAB9867B89EB63B0AEA3 /* Sources */, - F50D65DB4E954A05188C4DA2E5F328AD /* Frameworks */, - 2D88B190152CDA7209106DFA1875425D /* Resources */, + 828072279785568C99D718D9BE447138 /* Headers */, + E7B1BA3AD1FBD9810CE8D57A18AF9530 /* Sources */, + D68FC490C4574FCA3512CBAE2409A70A /* Frameworks */, + 5DFB869F1F187E28D2A6EBEB5200DD4C /* Resources */, ); buildRules = ( ); @@ -264,7 +261,7 @@ buildRules = ( ); dependencies = ( - B710B108212DF0C270D24DB395E35A7A /* PBXTargetDependency */, + 6C1B38F4653B7B5C19F6EF9057739039 /* PBXTargetDependency */, ); name = "Pods-Networking-Example"; productName = Pods_Networking_Example; @@ -277,8 +274,8 @@ BFDFE7DC352907FC980B868725387E98 /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1240; - LastUpgradeCheck = 1240; + LastSwiftUpdateCheck = 1500; + LastUpgradeCheck = 1500; }; buildConfigurationList = 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */; compatibilityVersion = "Xcode 13.0"; @@ -289,6 +286,7 @@ en, ); mainGroup = CF1408CF629C7361332E53B88F7BD30C; + minimizedProjectReferenceProxies = 0; productRefGroup = F075B6EE478CA61A0712889E93206EB2 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -300,7 +298,7 @@ /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 2D88B190152CDA7209106DFA1875425D /* Resources */ = { + 5DFB869F1F187E28D2A6EBEB5200DD4C /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( @@ -325,39 +323,38 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - F1C6409B0EC3FAB9867B89EB63B0AEA3 /* Sources */ = { + E7B1BA3AD1FBD9810CE8D57A18AF9530 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 9CDA7CA194896CAFCA63E473509BF3DC /* DataTaskPublisher.swift in Sources */, - 71D1482BCCBAF39E69578A0376AFB60D /* DownloadPublisher.swift in Sources */, - F295DB8AC15F68BE94B2D24673A4609F /* Encodable.swift in Sources */, - 019F7A0350EEEAB1A11A32C5120F0419 /* EndpointType.swift in Sources */, - 8E7E328E2CAD37000C5B775F744D309F /* Header.swift in Sources */, - 2614DDD084892D5C6424C8A14503A6FC /* HTTP.swift in Sources */, - 863974EB459CE68B8DC821F7E2723D9F /* Networking-Swift-dummy.m in Sources */, - 999A79FE2004E7E16120A611463DF60D /* NetworkService.swift in Sources */, - 038091E4D70DCFEFC96F55BBE7851CCB /* Publisher.swift in Sources */, - 93E53DDE6196F2128A0298AC8ECBF4E6 /* Request.swift in Sources */, - 89B22F61A099049FC3856642ACFD2E15 /* Requestable.swift in Sources */, - 1C21D14C68262006616892EF2A03FA3C /* RequestConfig.swift in Sources */, - FFE71A14B639452954269AF6D3A1BAAF /* ServerConfig.swift in Sources */, - 319821ED03EB28985A1D017797D1811B /* StatusCode.swift in Sources */, - F77217FFAF586CA50195D6D62EA3DFA6 /* String.swift in Sources */, - 4594770555F7A7EBB4A4A76B463E350A /* TokenProvidable.swift in Sources */, - A5D4643885F5116699E20CB27CFFF8A9 /* URL.swift in Sources */, - 2ACC27A579CE0687B4B4BABFBD195419 /* URLRequest.swift in Sources */, + D79287819DA2CAC2820B5904AD58C2A7 /* Downloader.swift in Sources */, + 3116CC76DD3A96E38078A8D861D293C4 /* Encodable.swift in Sources */, + 930F9BC5D0633214D99D2F27B10ED666 /* EndpointType.swift in Sources */, + 965A7B733370CB8F64895273360C2B08 /* Header.swift in Sources */, + FD28D0E2B646887999539832A279FB9C /* HTTP.swift in Sources */, + 08D5323379488F28320E54EB91510313 /* Networking-Swift-dummy.m in Sources */, + 83A8D4E502E80B2B89F3E25DF604D294 /* NetworkService.swift in Sources */, + AC6E207ED31AE3F24159F7269155AD5F /* Publisher.swift in Sources */, + 50B1C221F1866198BD752348DD1C1EFB /* Request.swift in Sources */, + 007DCF26675B733B9D7DE1EF5CB2BED7 /* Requestable.swift in Sources */, + 32FAEC52A2CC18F830C4CD380648888E /* RequestConfig.swift in Sources */, + 1F2BA4256210FFF3228872320C109849 /* ServerConfig.swift in Sources */, + C48CBA664A7E299CBB4528F1B552EBDA /* StatusCode.swift in Sources */, + B4BDDDBD5783FBE0C50F40F17574933A /* String.swift in Sources */, + 83AED815F02A7C717B6CC9FE3BB8D0CF /* TokenProvidable.swift in Sources */, + 7F0A5387922C0767C62E690FC442D8F6 /* URL.swift in Sources */, + A06B852DBD18C3A1C875702DF2B61BF7 /* URLRequest.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - B710B108212DF0C270D24DB395E35A7A /* PBXTargetDependency */ = { + 6C1B38F4653B7B5C19F6EF9057739039 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "Networking-Swift"; target = 3BB699068123F93F580B5B337163BBDE /* Networking-Swift */; - targetProxy = BD3E8A5D10B1B9C9E7C960C65D6E56BD /* PBXContainerItemProxy */; + targetProxy = 69AA98D9FEBCBEC8A858B3C2D287E547 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -399,41 +396,6 @@ }; name = Debug; }; - 2962978FBD2B5F87BFB886F04C7F9C83 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 2ECA793B3E070633C656D37899B85825 /* Networking-Swift.debug.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = NO; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_PREFIX_HEADER = "Target Support Files/Networking-Swift/Networking-Swift-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/Networking-Swift/Networking-Swift-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - MODULEMAP_FILE = "Target Support Files/Networking-Swift/Networking-Swift.modulemap"; - PRODUCT_MODULE_NAME = Networking_Swift; - PRODUCT_NAME = Networking_Swift; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_VERSION = 5.4; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; 33BB9D863AC0CAAEB46A618FA71D7046 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = E76EF03CE12138874AC55F6B0B5A9F39 /* Pods-Networking-Example.release.xcconfig */; @@ -472,9 +434,9 @@ }; name = Release; }; - 4B786DF00DD484ED861ECE1DF3DAA801 /* Release */ = { + 61FB1D9FF098D0923D55BCDC8BD605F7 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 5BE9AFA7AE5FE9F1A8B5F283F626D651 /* Networking-Swift.release.xcconfig */; + baseConfigurationReference = 5A4BD780D66154F4DD22F7FEA467CB5A /* Networking-Swift.release.xcconfig */; buildSettings = { CLANG_ENABLE_OBJC_WEAK = NO; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; @@ -636,6 +598,41 @@ }; name = Release; }; + DFADDDF9C21CD54B0ED189C99ED9FB29 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 37573F36218C4DACE091C774F7D36934 /* Networking-Swift.debug.xcconfig */; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = NO; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/Networking-Swift/Networking-Swift-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Networking-Swift/Networking-Swift-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MODULEMAP_FILE = "Target Support Files/Networking-Swift/Networking-Swift.modulemap"; + PRODUCT_MODULE_NAME = Networking_Swift; + PRODUCT_NAME = Networking_Swift; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.4; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -648,20 +645,20 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - A92328F0DB3E8605F0AC55D78B4F22FE /* Build configuration list for PBXNativeTarget "Pods-Networking-Example" */ = { + 8D4C8652D7B44240E2431DB02FCC1B46 /* Build configuration list for PBXNativeTarget "Networking-Swift" */ = { isa = XCConfigurationList; buildConfigurations = ( - 0F6429E4DF58126CA1A3195556C207E6 /* Debug */, - 33BB9D863AC0CAAEB46A618FA71D7046 /* Release */, + DFADDDF9C21CD54B0ED189C99ED9FB29 /* Debug */, + 61FB1D9FF098D0923D55BCDC8BD605F7 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - AB59D86DF6E5E5040629B1AB95FD4569 /* Build configuration list for PBXNativeTarget "Networking-Swift" */ = { + A92328F0DB3E8605F0AC55D78B4F22FE /* Build configuration list for PBXNativeTarget "Pods-Networking-Example" */ = { isa = XCConfigurationList; buildConfigurations = ( - 2962978FBD2B5F87BFB886F04C7F9C83 /* Debug */, - 4B786DF00DD484ED861ECE1DF3DAA801 /* Release */, + 0F6429E4DF58126CA1A3195556C207E6 /* Debug */, + 33BB9D863AC0CAAEB46A618FA71D7046 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/Networking-Example/Pods/Target Support Files/Networking-Swift/Networking-Swift-Info.plist b/Networking-Example/Pods/Target Support Files/Networking-Swift/Networking-Swift-Info.plist index 6ff6311..7089538 100644 --- a/Networking-Example/Pods/Target Support Files/Networking-Swift/Networking-Swift-Info.plist +++ b/Networking-Example/Pods/Target Support Files/Networking-Swift/Networking-Swift-Info.plist @@ -3,7 +3,7 @@ CFBundleDevelopmentRegion - en + ${PODS_DEVELOPMENT_LANGUAGE} CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.8.9 + 0.9.0 CFBundleSignature ???? CFBundleVersion diff --git a/Networking-Example/Pods/Target Support Files/Networking-Swift/Networking-Swift.debug.xcconfig b/Networking-Example/Pods/Target Support Files/Networking-Swift/Networking-Swift.debug.xcconfig index cb38963..b56bcbf 100644 --- a/Networking-Example/Pods/Target Support Files/Networking-Swift/Networking-Swift.debug.xcconfig +++ b/Networking-Example/Pods/Target Support Files/Networking-Swift/Networking-Swift.debug.xcconfig @@ -1,10 +1,11 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Networking-Swift GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift +LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS PODS_BUILD_DIR = ${BUILD_DIR} PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_DEVELOPMENT_LANGUAGE = ${DEVELOPMENT_LANGUAGE} PODS_ROOT = ${SRCROOT} PODS_TARGET_SRCROOT = ${PODS_ROOT}/Networking-Swift PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates diff --git a/Networking-Example/Pods/Target Support Files/Networking-Swift/Networking-Swift.release.xcconfig b/Networking-Example/Pods/Target Support Files/Networking-Swift/Networking-Swift.release.xcconfig index cb38963..b56bcbf 100644 --- a/Networking-Example/Pods/Target Support Files/Networking-Swift/Networking-Swift.release.xcconfig +++ b/Networking-Example/Pods/Target Support Files/Networking-Swift/Networking-Swift.release.xcconfig @@ -1,10 +1,11 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Networking-Swift GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift +LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS PODS_BUILD_DIR = ${BUILD_DIR} PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_DEVELOPMENT_LANGUAGE = ${DEVELOPMENT_LANGUAGE} PODS_ROOT = ${SRCROOT} PODS_TARGET_SRCROOT = ${PODS_ROOT}/Networking-Swift PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates diff --git a/Networking-Example/Pods/Target Support Files/Pods-Networking-Example/Pods-Networking-Example-Info.plist b/Networking-Example/Pods/Target Support Files/Pods-Networking-Example/Pods-Networking-Example-Info.plist index 2243fe6..19cf209 100644 --- a/Networking-Example/Pods/Target Support Files/Pods-Networking-Example/Pods-Networking-Example-Info.plist +++ b/Networking-Example/Pods/Target Support Files/Pods-Networking-Example/Pods-Networking-Example-Info.plist @@ -3,7 +3,7 @@ CFBundleDevelopmentRegion - en + ${PODS_DEVELOPMENT_LANGUAGE} CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier diff --git a/Networking-Example/Pods/Target Support Files/Pods-Networking-Example/Pods-Networking-Example-acknowledgements.markdown b/Networking-Example/Pods/Target Support Files/Pods-Networking-Example/Pods-Networking-Example-acknowledgements.markdown index a81ec44..9f56c5f 100644 --- a/Networking-Example/Pods/Target Support Files/Pods-Networking-Example/Pods-Networking-Example-acknowledgements.markdown +++ b/Networking-Example/Pods/Target Support Files/Pods-Networking-Example/Pods-Networking-Example-acknowledgements.markdown @@ -5,7 +5,7 @@ This application makes use of the following third party libraries: MIT License -Copyright (c) 2023 Viktor Gidlöf +Copyright (c) 2024 Viktor Gidlöf Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Networking-Example/Pods/Target Support Files/Pods-Networking-Example/Pods-Networking-Example-acknowledgements.plist b/Networking-Example/Pods/Target Support Files/Pods-Networking-Example/Pods-Networking-Example-acknowledgements.plist index b484196..33795f4 100644 --- a/Networking-Example/Pods/Target Support Files/Pods-Networking-Example/Pods-Networking-Example-acknowledgements.plist +++ b/Networking-Example/Pods/Target Support Files/Pods-Networking-Example/Pods-Networking-Example-acknowledgements.plist @@ -16,7 +16,7 @@ FooterText MIT License -Copyright (c) 2023 Viktor Gidlöf +Copyright (c) 2024 Viktor Gidlöf Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Networking-Example/Pods/Target Support Files/Pods-Networking-Example/Pods-Networking-Example-frameworks.sh b/Networking-Example/Pods/Target Support Files/Pods-Networking-Example/Pods-Networking-Example-frameworks.sh index 6a5adfa..e1013d6 100755 --- a/Networking-Example/Pods/Target Support Files/Pods-Networking-Example/Pods-Networking-Example-frameworks.sh +++ b/Networking-Example/Pods/Target Support Files/Pods-Networking-Example/Pods-Networking-Example-frameworks.sh @@ -18,7 +18,7 @@ echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" -SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" +SWIFT_STDLIB_PATH="${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" BCSYMBOLMAP_DIR="BCSymbolMaps" @@ -41,7 +41,7 @@ install_framework() if [ -L "${source}" ]; then echo "Symlinked..." - source="$(readlink "${source}")" + source="$(readlink -f "${source}")" fi if [ -d "${source}/${BCSYMBOLMAP_DIR}" ]; then diff --git a/Networking-Example/Pods/Target Support Files/Pods-Networking-Example/Pods-Networking-Example.debug.xcconfig b/Networking-Example/Pods/Target Support Files/Pods-Networking-Example/Pods-Networking-Example.debug.xcconfig index af1959d..72020a8 100644 --- a/Networking-Example/Pods/Target Support Files/Pods-Networking-Example/Pods-Networking-Example.debug.xcconfig +++ b/Networking-Example/Pods/Target Support Files/Pods-Networking-Example/Pods-Networking-Example.debug.xcconfig @@ -4,7 +4,7 @@ FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Networkin GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Networking-Swift/Networking_Swift.framework/Headers" LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift '@executable_path/Frameworks' '@loader_path/Frameworks' -LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift +LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift OTHER_LDFLAGS = $(inherited) -framework "Networking_Swift" OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS PODS_BUILD_DIR = ${BUILD_DIR} diff --git a/Networking-Example/Pods/Target Support Files/Pods-Networking-Example/Pods-Networking-Example.release.xcconfig b/Networking-Example/Pods/Target Support Files/Pods-Networking-Example/Pods-Networking-Example.release.xcconfig index af1959d..72020a8 100644 --- a/Networking-Example/Pods/Target Support Files/Pods-Networking-Example/Pods-Networking-Example.release.xcconfig +++ b/Networking-Example/Pods/Target Support Files/Pods-Networking-Example/Pods-Networking-Example.release.xcconfig @@ -4,7 +4,7 @@ FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Networkin GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Networking-Swift/Networking_Swift.framework/Headers" LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift '@executable_path/Frameworks' '@loader_path/Frameworks' -LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift +LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift OTHER_LDFLAGS = $(inherited) -framework "Networking_Swift" OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS PODS_BUILD_DIR = ${BUILD_DIR}