From 567d48aefac5b117b04b6e1332bfd2d55eb0535d Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Sun, 30 Apr 2023 15:25:09 +0200 Subject: [PATCH 1/2] Made the MockURLProtocol class available for non Apple platforms by importing the FoundationNetworking framework. --- Sources/Communications/Classes/MockURLProtocol.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Sources/Communications/Classes/MockURLProtocol.swift b/Sources/Communications/Classes/MockURLProtocol.swift index f4122a6..e634324 100644 --- a/Sources/Communications/Classes/MockURLProtocol.swift +++ b/Sources/Communications/Classes/MockURLProtocol.swift @@ -10,9 +10,12 @@ // //===----------------------------------------------------------------------===// -#if os(iOS) || os(macOS) || os(tvOS) || os(watchOS) import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif + /// This class overrides the `URLProtocol` protocol used by the `URLSession` to handle the loading of protocol-specific URL data so it is possible to mock URL response for testing purposes. public class MockURLProtocol: URLProtocol { @@ -117,4 +120,3 @@ public struct MockURLResponse { } } -#endif -- 2.47.1 From f84b04e8df556677ab845df0c6d4feb529ff3a38 Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Sun, 30 Apr 2023 15:26:15 +0200 Subject: [PATCH 2/2] Updated some text in the README file. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c348c0d..b6677e8 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ In the intended `Package.swift` file, it is required to add the following depend ```swift dependencies: [ // ... - .package(url: "https://github.com/rock-n-code/swift-libs.git", from: "0.1.5") + .package(url: "https://github.com/rock-n-code/swift-libs.git", from: "0.1.7") // ... ], ``` @@ -66,7 +66,7 @@ In an opened Xcode project, it is required to follow these steps to install the 4. press on the *+* (plus) button to add dependencies to the project; 5. enter the URL `https://github.com/rock-n-code/swift-libs.git` into the *Search or Enter Package URL* located in the upper right corner; 6. select the retrieved option; -7. define the dependency rule (the *Up to Next Major Version* option and the *0.1.5* text are recommended); +7. define the dependency rule (the *Up to Next Major Version* option and the *0.1.7* text are recommended); 8. select the target to which the dependency will be applied (if required); 9. wait for the package to be resolved and included in the project; 10. now you should be ready to start using this package! -- 2.47.1