Skip to content

Commit 781e523

Browse files
authored
Merge pull request #42 from GoodRequest/swift-6.2
Swift 6.2 & GoodNetworking 4.0
2 parents 13e911f + 41d761f commit 781e523

87 files changed

Lines changed: 2545 additions & 3981 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.swiftpm/xcode/xcshareddata/xcschemes/GoodNetworking.xcscheme

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1610"
3+
LastUpgradeVersion = "1600"
44
version = "1.7">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -29,6 +29,18 @@
2929
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
3030
shouldUseLaunchSchemeArgsEnv = "YES"
3131
shouldAutocreateTestPlan = "YES">
32+
<Testables>
33+
<TestableReference
34+
skipped = "NO">
35+
<BuildableReference
36+
BuildableIdentifier = "primary"
37+
BlueprintIdentifier = "GoodNetworkingTests"
38+
BuildableName = "GoodNetworkingTests"
39+
BlueprintName = "GoodNetworkingTests"
40+
ReferencedContainer = "container:">
41+
</BuildableReference>
42+
</TestableReference>
43+
</Testables>
3244
</TestAction>
3345
<LaunchAction
3446
buildConfiguration = "Debug"

.swiftpm/xcode/xcshareddata/xcschemes/GoodNetworkingTests.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1610"
3+
LastUpgradeVersion = "1600"
44
version = "1.7">
55
<BuildAction
66
parallelizeBuildables = "YES"

GoodNetworking-Sample/GoodNetworking-Sample.xcodeproj/project.pbxproj

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@
1717
09A9ECA12C48115A0032C359 /* GoodSwiftUI in Frameworks */ = {isa = PBXBuildFile; productRef = 09A9ECA02C48115A0032C359 /* GoodSwiftUI */; };
1818
09A9ECA32C4811B00032C359 /* UserListScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09A9ECA22C4811B00032C359 /* UserListScreen.swift */; };
1919
09A9ECAE2C4AC9810032C359 /* JobUser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09A9ECAD2C4AC9810032C359 /* JobUser.swift */; };
20+
3F8799A12DF703B000B4286B /* SampleLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F8799A02DF703B000B4286B /* SampleLogger.swift */; };
2021
5D4200142CBEE7ED006C4292 /* UserDefaultsExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D4200132CBEE7ED006C4292 /* UserDefaultsExtensions.swift */; };
2122
5D4200192CBF97CC006C4292 /* ServerPickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D4200182CBF97CC006C4292 /* ServerPickerView.swift */; };
2223
5D4A967C299C190B00DFAEAE /* GoodNetworking in Frameworks */ = {isa = PBXBuildFile; productRef = 5D4A967B299C190B00DFAEAE /* GoodNetworking */; };
24+
5D4A967E299C190B00DFAEAE /* Mockable in Frameworks */ = {isa = PBXBuildFile; productRef = 5D4A967D299C190B00DFAEAE /* Mockable */; };
2325
5D7C80652CA2CDB900116E10 /* SampleSelectableBaseUrlProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D7C80642CA2CDB900116E10 /* SampleSelectableBaseUrlProvider.swift */; };
2426
5D9BD7322CBD19C100667B76 /* ApiServerCollection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D9BD7312CBD19C100667B76 /* ApiServerCollection.swift */; };
2527
5D9BD7332CBD19C100667B76 /* ApiServer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D9BD7302CBD19C100667B76 /* ApiServer.swift */; };
26-
5DBCDC302D53746A00DE6D04 /* Mockable in Frameworks */ = {isa = PBXBuildFile; productRef = 5DBCDC2F2D53746A00DE6D04 /* Mockable */; };
2728
EACEC3FA29953DCB008242AA /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EACEC3F929953DCB008242AA /* AppDelegate.swift */; };
2829
EACEC40829953DCD008242AA /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EACEC40629953DCD008242AA /* LaunchScreen.storyboard */; };
2930
/* End PBXBuildFile section */
@@ -35,13 +36,13 @@
3536
09A9EC992C48015C0032C359 /* SampleEndpoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleEndpoint.swift; sourceTree = "<group>"; };
3637
09A9ECA22C4811B00032C359 /* UserListScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserListScreen.swift; sourceTree = "<group>"; };
3738
09A9ECAD2C4AC9810032C359 /* JobUser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JobUser.swift; sourceTree = "<group>"; };
39+
3F8799A02DF703B000B4286B /* SampleLogger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleLogger.swift; sourceTree = "<group>"; };
3840
5D4200132CBEE7ED006C4292 /* UserDefaultsExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDefaultsExtensions.swift; sourceTree = "<group>"; };
3941
5D4200182CBF97CC006C4292 /* ServerPickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ServerPickerView.swift; sourceTree = "<group>"; };
4042
5D4A967A299C18FB00DFAEAE /* GoodNetworking */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = GoodNetworking; path = ..; sourceTree = "<group>"; };
4143
5D7C80642CA2CDB900116E10 /* SampleSelectableBaseUrlProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleSelectableBaseUrlProvider.swift; sourceTree = "<group>"; };
4244
5D9BD7302CBD19C100667B76 /* ApiServer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApiServer.swift; sourceTree = "<group>"; };
4345
5D9BD7312CBD19C100667B76 /* ApiServerCollection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApiServerCollection.swift; sourceTree = "<group>"; };
44-
5D9E57CA2D52B1A40060F854 /* SampleDeduplicatingResultProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleDeduplicatingResultProvider.swift; sourceTree = "<group>"; };
4546
EACEC3F629953DCB008242AA /* GoodNetworking-Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "GoodNetworking-Sample.app"; sourceTree = BUILT_PRODUCTS_DIR; };
4647
EACEC3F929953DCB008242AA /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
4748
EACEC40729953DCD008242AA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
@@ -55,9 +56,9 @@
5556
files = (
5657
0973C9FD2C4C3FC6007BAF6A /* GoodMacros in Frameworks */,
5758
09A9ECA12C48115A0032C359 /* GoodSwiftUI in Frameworks */,
58-
5DBCDC302D53746A00DE6D04 /* Mockable in Frameworks */,
5959
09A9EC9D2C48115A0032C359 /* GRAsyncImage in Frameworks */,
6060
09A9EC9F2C48115A0032C359 /* GRInputField in Frameworks */,
61+
5D4A967E299C190B00DFAEAE /* Mockable in Frameworks */,
6162
5D4A967C299C190B00DFAEAE /* GoodNetworking in Frameworks */,
6263
);
6364
runOnlyForDeploymentPostprocessing = 0;
@@ -92,6 +93,7 @@
9293
09A9EC942C4800B90032C359 /* SampleNetworkSessions.swift */,
9394
09A9EC992C48015C0032C359 /* SampleEndpoint.swift */,
9495
5D7C80642CA2CDB900116E10 /* SampleSelectableBaseUrlProvider.swift */,
96+
3F8799A02DF703B000B4286B /* SampleLogger.swift */,
9597
);
9698
path = Managers;
9799
sourceTree = "<group>";
@@ -112,14 +114,6 @@
112114
name = Packages;
113115
sourceTree = "<group>";
114116
};
115-
5DBCDC2E2D53720F00DE6D04 /* Provider */ = {
116-
isa = PBXGroup;
117-
children = (
118-
5D9E57CA2D52B1A40060F854 /* SampleDeduplicatingResultProvider.swift */,
119-
);
120-
path = Provider;
121-
sourceTree = "<group>";
122-
};
123117
EACEC3ED29953DCB008242AA = {
124118
isa = PBXGroup;
125119
children = (
@@ -144,7 +138,6 @@
144138
EACEC433299582F0008242AA /* Application */,
145139
5D4200152CBEE7F2006C4292 /* Extensions */,
146140
09A9EC902C4800240032C359 /* Models */,
147-
5DBCDC2E2D53720F00DE6D04 /* Provider */,
148141
09A9EC932C4800AA0032C359 /* Managers */,
149142
09A9EC8D2C47FF830032C359 /* Screens */,
150143
);
@@ -186,11 +179,11 @@
186179
name = "GoodNetworking-Sample";
187180
packageProductDependencies = (
188181
5D4A967B299C190B00DFAEAE /* GoodNetworking */,
182+
5D4A967D299C190B00DFAEAE /* Mockable */,
189183
09A9EC9C2C48115A0032C359 /* GRAsyncImage */,
190184
09A9EC9E2C48115A0032C359 /* GRInputField */,
191185
09A9ECA02C48115A0032C359 /* GoodSwiftUI */,
192186
0973C9FC2C4C3FC6007BAF6A /* GoodMacros */,
193-
5DBCDC2F2D53746A00DE6D04 /* Mockable */,
194187
);
195188
productName = "GoodNetworking-Sample";
196189
productReference = EACEC3F629953DCB008242AA /* GoodNetworking-Sample.app */;
@@ -204,7 +197,7 @@
204197
attributes = {
205198
BuildIndependentTargetsInParallel = 1;
206199
LastSwiftUpdateCheck = 1410;
207-
LastUpgradeCheck = 1610;
200+
LastUpgradeCheck = 1600;
208201
TargetAttributes = {
209202
EACEC3F529953DCB008242AA = {
210203
CreatedOnToolsVersion = 14.1;
@@ -250,6 +243,7 @@
250243
buildActionMask = 2147483647;
251244
files = (
252245
09A9ECA32C4811B00032C359 /* UserListScreen.swift in Sources */,
246+
3F8799A12DF703B000B4286B /* SampleLogger.swift in Sources */,
253247
09A9EC9A2C48015C0032C359 /* SampleEndpoint.swift in Sources */,
254248
09A9EC8F2C47FF8E0032C359 /* UserScreen.swift in Sources */,
255249
EACEC3FA29953DCB008242AA /* AppDelegate.swift in Sources */,
@@ -282,7 +276,6 @@
282276
isa = XCBuildConfiguration;
283277
buildSettings = {
284278
ALWAYS_SEARCH_USER_PATHS = NO;
285-
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
286279
CLANG_ANALYZER_NONNULL = YES;
287280
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
288281
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
@@ -345,7 +338,6 @@
345338
isa = XCBuildConfiguration;
346339
buildSettings = {
347340
ALWAYS_SEARCH_USER_PATHS = NO;
348-
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
349341
CLANG_ANALYZER_NONNULL = YES;
350342
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
351343
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
@@ -525,7 +517,7 @@
525517
isa = XCSwiftPackageProductDependency;
526518
productName = GoodNetworking;
527519
};
528-
5DBCDC2F2D53746A00DE6D04 /* Mockable */ = {
520+
5D4A967D299C190B00DFAEAE /* Mockable */ = {
529521
isa = XCSwiftPackageProductDependency;
530522
productName = Mockable;
531523
};

GoodNetworking-Sample/GoodNetworking-Sample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 7 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

GoodNetworking-Sample/GoodNetworking-Sample.xcodeproj/xcshareddata/xcschemes/GoodNetworking-Sample.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1610"
3+
LastUpgradeVersion = "1600"
44
version = "1.7">
55
<BuildAction
66
parallelizeBuildables = "YES"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//
2+
// SampleLogger.swift
3+
// GoodNetworking-Sample
4+
//
5+
// Created by Matus Klasovity on 09/06/2025.
6+
//
7+
8+
import Foundation
9+
import GoodNetworking
10+
11+
struct SampleLogger: NetworkLogger {
12+
13+
func logNetworkEvent(message: Any, level: LogLevel, fileName: String, lineNumber: Int) {
14+
switch level {
15+
case .debug:
16+
print("[DEBUG] \(fileName):\(lineNumber) - \(message)")
17+
case .info:
18+
print("[INFO] \(fileName):\(lineNumber) - \(message)")
19+
case .warning:
20+
print("[WARNING] \(fileName):\(lineNumber) - \(message)")
21+
case .error:
22+
print("[ERROR] \(fileName):\(lineNumber) - \(message)")
23+
}
24+
}
25+
26+
}

GoodNetworking-Sample/GoodNetworking-Sample/Managers/SampleNetworkSessions.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ extension NetworkSession {
3535
let urlProvider = CustomBaseUrlProvider(serverCollection: prodServerCollection)
3636
#endif
3737
baseURLProvider = urlProvider
38-
NetworkSession.sampleSession = NetworkSession(baseUrl: urlProvider)
38+
NetworkSession.sampleSession = NetworkSession(
39+
baseUrl: urlProvider,
40+
configuration: .default(logger: SampleLogger()),
41+
logger: SampleLogger()
42+
)
3943
}
4044

4145
}

GoodNetworking-Sample/GoodNetworking-Sample/Models/User.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct UserRequest: Encodable {
3232

3333
// MARK: - Read response
3434

35-
struct UserResponse: Codable, WithCustomDecoder, Equatable {
35+
struct UserResponse: Decodable, WithCustomDecoder {
3636

3737
static let keyDecodingStrategy: JSONDecoder.KeyDecodingStrategy = .convertFromSnakeCase
3838

GoodNetworking-Sample/GoodNetworking-Sample/Provider/SampleDeduplicatingResultProvider.swift

Lines changed: 0 additions & 100 deletions
This file was deleted.

GoodNetworking-Sample/GoodNetworking-Sample/Screens/UserListScreen.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ struct UserListScreen: View {
1313

1414
// MARK: - State
1515

16-
@State private var users = Resource(session: .sampleSession, remote: RemoteUser.self)
16+
@State private var users = Resource(
17+
session: .sampleSession,
18+
remote: RemoteUser.self,
19+
logger: SampleLogger()
20+
)
1721
@State private var didLoadList = false
1822
@State private var presentServerSettings = false
1923

0 commit comments

Comments
 (0)