Skip to content

Commit 0f5b7e3

Browse files
authored
Merge pull request #8 from GoodRequest/GoodCoordinator-update
GoodCoordinator update & Coordinator protocol
2 parents 7355c0c + 00bfce1 commit 0f5b7e3

File tree

24 files changed

+973
-251
lines changed

24 files changed

+973
-251
lines changed

.swiftpm/xcode/xcshareddata/xcschemes/GoodReactor-Package.xcscheme

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@
7878
ReferencedContainer = "container:">
7979
</BuildableReference>
8080
</TestableReference>
81+
<TestableReference
82+
skipped = "NO">
83+
<BuildableReference
84+
BuildableIdentifier = "primary"
85+
BlueprintIdentifier = "GoodCoordinatorTests"
86+
BuildableName = "GoodCoordinatorTests"
87+
BlueprintName = "GoodCoordinatorTests"
88+
ReferencedContainer = "container:">
89+
</BuildableReference>
90+
</TestableReference>
8191
</Testables>
8292
</TestAction>
8393
<LaunchAction
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1610"
4+
version = "1.7">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES"
8+
buildArchitectures = "Automatic">
9+
</BuildAction>
10+
<TestAction
11+
buildConfiguration = "Debug"
12+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
13+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
14+
shouldUseLaunchSchemeArgsEnv = "YES"
15+
shouldAutocreateTestPlan = "YES">
16+
<Testables>
17+
<TestableReference
18+
skipped = "NO">
19+
<BuildableReference
20+
BuildableIdentifier = "primary"
21+
BlueprintIdentifier = "GoodReactorTests"
22+
BuildableName = "GoodReactorTests"
23+
BlueprintName = "GoodReactorTests"
24+
ReferencedContainer = "container:">
25+
</BuildableReference>
26+
</TestableReference>
27+
</Testables>
28+
</TestAction>
29+
<LaunchAction
30+
buildConfiguration = "Debug"
31+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
32+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
33+
launchStyle = "0"
34+
useCustomWorkingDirectory = "NO"
35+
ignoresPersistentStateOnLaunch = "NO"
36+
debugDocumentVersioning = "YES"
37+
debugServiceExtension = "internal"
38+
allowLocationSimulation = "YES">
39+
</LaunchAction>
40+
<ProfileAction
41+
buildConfiguration = "Release"
42+
shouldUseLaunchSchemeArgsEnv = "YES"
43+
savedToolIdentifier = ""
44+
useCustomWorkingDirectory = "NO"
45+
debugDocumentVersioning = "YES">
46+
</ProfileAction>
47+
<AnalyzeAction
48+
buildConfiguration = "Debug">
49+
</AnalyzeAction>
50+
<ArchiveAction
51+
buildConfiguration = "Release"
52+
revealArchiveInOrganizer = "YES">
53+
</ArchiveAction>
54+
</Scheme>

GoodReactor-Sample/GoodReactor-Sample.xcodeproj/project.pbxproj

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
099D61732C8472D300B86922 /* GoodNetworking in Frameworks */ = {isa = PBXBuildFile; productRef = 099D61722C8472D300B86922 /* GoodNetworking */; };
1515
099D617F2C84A3CC00B86922 /* RandomNumber.swift in Sources */ = {isa = PBXBuildFile; fileRef = 099D617C2C84A3CC00B86922 /* RandomNumber.swift */; };
1616
099D61802C84A3CC00B86922 /* RNGEndpoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 099D617D2C84A3CC00B86922 /* RNGEndpoint.swift */; };
17+
6B9596242D3E690B0037D874 /* GoodNetworking in Frameworks */ = {isa = PBXBuildFile; productRef = 6B9596232D3E690B0037D874 /* GoodNetworking */; };
1718
EA51F944299424A900B14A7C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA51F943299424A900B14A7C /* AppDelegate.swift */; };
1819
EA51F94F299424AA00B14A7C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EA51F94E299424AA00B14A7C /* Assets.xcassets */; };
1920
EA51F952299424AA00B14A7C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EA51F950299424AA00B14A7C /* LaunchScreen.storyboard */; };
20-
EA51F96029942B3C00B14A7C /* Coordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA51F95F29942B3C00B14A7C /* Coordinator.swift */; };
2121
EA51F96229942B6700B14A7C /* AppCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA51F96129942B6700B14A7C /* AppCoordinator.swift */; };
2222
EA51F96429942B8300B14A7C /* HomeCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA51F96329942B8300B14A7C /* HomeCoordinator.swift */; };
2323
EA51F96829942BBF00B14A7C /* HomeViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA51F96629942BBF00B14A7C /* HomeViewModel.swift */; };
@@ -45,7 +45,6 @@
4545
EA51F94E299424AA00B14A7C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
4646
EA51F951299424AA00B14A7C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
4747
EA51F953299424AA00B14A7C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
48-
EA51F95F29942B3C00B14A7C /* Coordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Coordinator.swift; sourceTree = "<group>"; };
4948
EA51F96129942B6700B14A7C /* AppCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppCoordinator.swift; sourceTree = "<group>"; };
5049
EA51F96329942B8300B14A7C /* HomeCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeCoordinator.swift; sourceTree = "<group>"; };
5150
EA51F96629942BBF00B14A7C /* HomeViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeViewModel.swift; sourceTree = "<group>"; };
@@ -84,6 +83,7 @@
8483
099D61702C83447900B86922 /* GoodCoordinator in Frameworks */,
8584
099D61732C8472D300B86922 /* GoodNetworking in Frameworks */,
8685
09545AF02CB6704900DC5A61 /* LegacyReactor in Frameworks */,
86+
6B9596242D3E690B0037D874 /* GoodNetworking in Frameworks */,
8787
);
8888
runOnlyForDeploymentPostprocessing = 0;
8989
};
@@ -162,7 +162,6 @@
162162
EA51F95E29942B1300B14A7C /* Coordinators */ = {
163163
isa = PBXGroup;
164164
children = (
165-
EA51F95F29942B3C00B14A7C /* Coordinator.swift */,
166165
EA51F96129942B6700B14A7C /* AppCoordinator.swift */,
167166
EA51F96329942B8300B14A7C /* HomeCoordinator.swift */,
168167
EABE433929950C9E00EB51BD /* AboutCoordinator.swift */,
@@ -302,6 +301,7 @@
302301
099D616F2C83447900B86922 /* GoodCoordinator */,
303302
099D61722C8472D300B86922 /* GoodNetworking */,
304303
09545AEF2CB6704900DC5A61 /* LegacyReactor */,
304+
6B9596232D3E690B0037D874 /* GoodNetworking */,
305305
);
306306
productName = "GoodReactor-Sample";
307307
productReference = EA51F940299424A900B14A7C /* GoodReactor-Sample.app */;
@@ -335,8 +335,8 @@
335335
);
336336
mainGroup = EA51F937299424A900B14A7C;
337337
packageReferences = (
338-
099D61712C8472D300B86922 /* XCLocalSwiftPackageReference "../../GoodNetworking" */,
339338
0908A6442C91C0B10035A749 /* XCLocalSwiftPackageReference "../../GoodCoordinator-iOS" */,
339+
6B9596222D3E690B0037D874 /* XCRemoteSwiftPackageReference "GoodNetworking" */,
340340
);
341341
productRefGroup = EA51F941299424A900B14A7C /* Products */;
342342
projectDirPath = "";
@@ -384,7 +384,6 @@
384384
EABE4336299507C700EB51BD /* UIButtonExtensions.swift in Sources */,
385385
EA751BBA29969882004016E1 /* MultiLineLabel.swift in Sources */,
386386
EA51F96429942B8300B14A7C /* HomeCoordinator.swift in Sources */,
387-
EA51F96029942B3C00B14A7C /* Coordinator.swift in Sources */,
388387
EABE43342995078800EB51BD /* ActionButton.swift in Sources */,
389388
EA51F9802994E04F00B14A7C /* UIControlExtensions.swift in Sources */,
390389
EA51F96829942BBF00B14A7C /* HomeViewModel.swift in Sources */,
@@ -693,12 +692,19 @@
693692
isa = XCLocalSwiftPackageReference;
694693
relativePath = "../../GoodCoordinator-iOS";
695694
};
696-
099D61712C8472D300B86922 /* XCLocalSwiftPackageReference "../../GoodNetworking" */ = {
697-
isa = XCLocalSwiftPackageReference;
698-
relativePath = ../../GoodNetworking;
699-
};
700695
/* End XCLocalSwiftPackageReference section */
701696

697+
/* Begin XCRemoteSwiftPackageReference section */
698+
6B9596222D3E690B0037D874 /* XCRemoteSwiftPackageReference "GoodNetworking" */ = {
699+
isa = XCRemoteSwiftPackageReference;
700+
repositoryURL = "https://github.com/GoodRequest/GoodNetworking";
701+
requirement = {
702+
branch = "resource-updating";
703+
kind = branch;
704+
};
705+
};
706+
/* End XCRemoteSwiftPackageReference section */
707+
702708
/* Begin XCSwiftPackageProductDependency section */
703709
0908A6452C91C0B10035A749 /* GoodCoordinator */ = {
704710
isa = XCSwiftPackageProductDependency;
@@ -720,6 +726,11 @@
720726
isa = XCSwiftPackageProductDependency;
721727
productName = GoodNetworking;
722728
};
729+
6B9596232D3E690B0037D874 /* GoodNetworking */ = {
730+
isa = XCSwiftPackageProductDependency;
731+
package = 6B9596222D3E690B0037D874 /* XCRemoteSwiftPackageReference "GoodNetworking" */;
732+
productName = GoodNetworking;
733+
};
723734
/* End XCSwiftPackageProductDependency section */
724735
};
725736
rootObject = EA51F938299424A900B14A7C /* Project object */;

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

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

GoodReactor-Sample/GoodReactor-Sample/Coordinators/AboutCoordinator.swift

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,17 @@
66
//
77

88
import UIKit
9+
import LegacyReactor
910

10-
enum AboutStep {}
11+
enum AboutStep {
1112

12-
class AboutCoordinator: Coordinator<AppStep> {
13+
case browser(URL)
1314

14-
override func start() -> AboutViewController {
15+
}
16+
17+
class AboutCoordinator: GoodCoordinator<AboutStep> {
18+
19+
override func start() -> UIViewController {
1520
super.start()
1621

1722
let aboutViewModel = AboutViewModel(coordinator: self)
@@ -24,13 +29,11 @@ class AboutCoordinator: Coordinator<AppStep> {
2429
return aboutViewController
2530
}
2631

27-
override func navigate(to stepper: AppStep) -> StepAction {
28-
switch stepper {
29-
case .safari(let url):
32+
override func navigate(to step: AboutStep) -> StepAction {
33+
print("DEBUG: - hello")
34+
switch step {
35+
case .browser(let url):
3036
return .safari(url)
31-
32-
default:
33-
return .none
3437
}
3538
}
3639

GoodReactor-Sample/GoodReactor-Sample/Coordinators/AppCoordinator.swift

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77

88
import UIKit
9+
import LegacyReactor
910

1011
enum AppStep {
1112

@@ -14,7 +15,7 @@ enum AppStep {
1415

1516
}
1617

17-
final class AppCoordinator: Coordinator<AppStep> {
18+
final class AppCoordinator: GoodCoordinator<AppStep> {
1819

1920
// MARK: - Constants
2021

@@ -26,6 +27,14 @@ final class AppCoordinator: Coordinator<AppStep> {
2627
self.window = window
2728
}
2829

30+
required init(rootViewController: UIViewController? = nil, parentCoordinator: (any Coordinator)? = nil) {
31+
fatalError("init(rootViewController:parentCoordinator:) has not been implemented")
32+
}
33+
34+
required convenience init(parentCoordinator: any Coordinator) {
35+
fatalError("init(parentCoordinator:) has not been implemented")
36+
}
37+
2938
@discardableResult
3039
override func start() -> UIViewController? {
3140
super.start()

0 commit comments

Comments
 (0)