Skip to content

Commit 468de81

Browse files
Merge branch 'feature/node-rewrite'
2 parents 9629bd3 + 50527b8 commit 468de81

File tree

12 files changed

+455
-168
lines changed

12 files changed

+455
-168
lines changed

FlowStacks.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = 'FlowStacks'
4-
s.version = '0.3.8'
4+
s.version = '0.4.0'
55
s.summary = 'Hoist navigation state into a coordinator in SwiftUI.'
66

77
s.description = <<-DESC

FlowStacksApp.xcodeproj/project.pbxproj

Lines changed: 132 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,23 @@
2323
526D9F2F26AF661F00B6B882 /* VMCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 526D9F2226AF661F00B6B882 /* VMCoordinator.swift */; };
2424
526D9F3326AF667000B6B882 /* FlowStacksApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 526D9F3226AF667000B6B882 /* FlowStacksApp.swift */; };
2525
526D9F3426AF667000B6B882 /* FlowStacksApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 526D9F3226AF667000B6B882 /* FlowStacksApp.swift */; };
26+
5285BBAF2B6408F500197CE7 /* FlowStacksAppUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5285BBAE2B6408F500197CE7 /* FlowStacksAppUITests.swift */; };
2627
52C5CCDE286EE92B0075ABA7 /* Deeplink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52C5CCDD286EE92B0075ABA7 /* Deeplink.swift */; };
2728
52C5CCDF286EE92B0075ABA7 /* Deeplink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52C5CCDD286EE92B0075ABA7 /* Deeplink.swift */; };
2829
77F136ED282E45E0008A6A02 /* ParentCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77F136EC282E45DF008A6A02 /* ParentCoordinator.swift */; };
2930
77F136EE282E45E0008A6A02 /* ParentCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77F136EC282E45DF008A6A02 /* ParentCoordinator.swift */; };
3031
/* End PBXBuildFile section */
3132

33+
/* Begin PBXContainerItemProxy section */
34+
5285BBB22B6408F500197CE7 /* PBXContainerItemProxy */ = {
35+
isa = PBXContainerItemProxy;
36+
containerPortal = 5241BF2726AA1D3A002D6892 /* Project object */;
37+
proxyType = 1;
38+
remoteGlobalIDString = 5241BF3226AA1D3B002D6892;
39+
remoteInfo = "FlowStacksApp (iOS)";
40+
};
41+
/* End PBXContainerItemProxy section */
42+
3243
/* Begin PBXFileReference section */
3344
5241BF3326AA1D3B002D6892 /* FlowStacksApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FlowStacksApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
3445
5241BF3926AA1D3B002D6892 /* FlowStacksApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FlowStacksApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -38,6 +49,8 @@
3849
526D9F1C26AF661F00B6B882 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
3950
526D9F2226AF661F00B6B882 /* VMCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VMCoordinator.swift; sourceTree = "<group>"; };
4051
526D9F3226AF667000B6B882 /* FlowStacksApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlowStacksApp.swift; sourceTree = "<group>"; };
52+
5285BBAC2B6408F500197CE7 /* FlowStacksAppUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FlowStacksAppUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
53+
5285BBAE2B6408F500197CE7 /* FlowStacksAppUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlowStacksAppUITests.swift; sourceTree = "<group>"; };
4154
52C5CCDB286E5D780075ABA7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4255
52C5CCDD286EE92B0075ABA7 /* Deeplink.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Deeplink.swift; sourceTree = "<group>"; };
4356
52E2C8F02A7265A00042C495 /* FlowStacks */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlowStacks; path = .; sourceTree = "<group>"; };
@@ -63,6 +76,13 @@
6376
);
6477
runOnlyForDeploymentPostprocessing = 0;
6578
};
79+
5285BBA92B6408F500197CE7 /* Frameworks */ = {
80+
isa = PBXFrameworksBuildPhase;
81+
buildActionMask = 2147483647;
82+
files = (
83+
);
84+
runOnlyForDeploymentPostprocessing = 0;
85+
};
6686
/* End PBXFrameworksBuildPhase section */
6787

6888
/* Begin PBXGroup section */
@@ -79,6 +99,7 @@
7999
children = (
80100
521678E12A2FD6AE00954579 /* Packages */,
81101
526D9F1B26AF661F00B6B882 /* FlowStacksApp */,
102+
5285BBAD2B6408F500197CE7 /* FlowStacksAppUITests */,
82103
5241BF3426AA1D3B002D6892 /* Products */,
83104
5241BF6D26AA1E8A002D6892 /* Frameworks */,
84105
);
@@ -89,6 +110,7 @@
89110
children = (
90111
5241BF3326AA1D3B002D6892 /* FlowStacksApp.app */,
91112
5241BF3926AA1D3B002D6892 /* FlowStacksApp.app */,
113+
5285BBAC2B6408F500197CE7 /* FlowStacksAppUITests.xctest */,
92114
);
93115
name = Products;
94116
sourceTree = "<group>";
@@ -124,6 +146,14 @@
124146
path = Shared;
125147
sourceTree = "<group>";
126148
};
149+
5285BBAD2B6408F500197CE7 /* FlowStacksAppUITests */ = {
150+
isa = PBXGroup;
151+
children = (
152+
5285BBAE2B6408F500197CE7 /* FlowStacksAppUITests.swift */,
153+
);
154+
path = FlowStacksAppUITests;
155+
sourceTree = "<group>";
156+
};
127157
/* End PBXGroup section */
128158

129159
/* Begin PBXNativeTarget section */
@@ -169,14 +199,32 @@
169199
productReference = 5241BF3926AA1D3B002D6892 /* FlowStacksApp.app */;
170200
productType = "com.apple.product-type.application";
171201
};
202+
5285BBAB2B6408F500197CE7 /* FlowStacksAppUITests */ = {
203+
isa = PBXNativeTarget;
204+
buildConfigurationList = 5285BBB62B6408F500197CE7 /* Build configuration list for PBXNativeTarget "FlowStacksAppUITests" */;
205+
buildPhases = (
206+
5285BBA82B6408F500197CE7 /* Sources */,
207+
5285BBA92B6408F500197CE7 /* Frameworks */,
208+
5285BBAA2B6408F500197CE7 /* Resources */,
209+
);
210+
buildRules = (
211+
);
212+
dependencies = (
213+
5285BBB32B6408F500197CE7 /* PBXTargetDependency */,
214+
);
215+
name = FlowStacksAppUITests;
216+
productName = FlowStacksAppUITests;
217+
productReference = 5285BBAC2B6408F500197CE7 /* FlowStacksAppUITests.xctest */;
218+
productType = "com.apple.product-type.bundle.ui-testing";
219+
};
172220
/* End PBXNativeTarget section */
173221

174222
/* Begin PBXProject section */
175223
5241BF2726AA1D3A002D6892 /* Project object */ = {
176224
isa = PBXProject;
177225
attributes = {
178226
BuildIndependentTargetsInParallel = 1;
179-
LastSwiftUpdateCheck = 1300;
227+
LastSwiftUpdateCheck = 1510;
180228
LastUpgradeCheck = 1500;
181229
TargetAttributes = {
182230
5241BF3226AA1D3B002D6892 = {
@@ -185,6 +233,10 @@
185233
5241BF3826AA1D3B002D6892 = {
186234
CreatedOnToolsVersion = 13.0;
187235
};
236+
5285BBAB2B6408F500197CE7 = {
237+
CreatedOnToolsVersion = 15.1;
238+
TestTargetID = 5241BF3226AA1D3B002D6892;
239+
};
188240
};
189241
};
190242
buildConfigurationList = 5241BF2A26AA1D3A002D6892 /* Build configuration list for PBXProject "FlowStacksApp" */;
@@ -205,6 +257,7 @@
205257
targets = (
206258
5241BF3226AA1D3B002D6892 /* FlowStacksApp (iOS) */,
207259
5241BF3826AA1D3B002D6892 /* FlowStacksApp (macOS) */,
260+
5285BBAB2B6408F500197CE7 /* FlowStacksAppUITests */,
208261
);
209262
};
210263
/* End PBXProject section */
@@ -226,6 +279,13 @@
226279
);
227280
runOnlyForDeploymentPostprocessing = 0;
228281
};
282+
5285BBAA2B6408F500197CE7 /* Resources */ = {
283+
isa = PBXResourcesBuildPhase;
284+
buildActionMask = 2147483647;
285+
files = (
286+
);
287+
runOnlyForDeploymentPostprocessing = 0;
288+
};
229289
/* End PBXResourcesBuildPhase section */
230290

231291
/* Begin PBXSourcesBuildPhase section */
@@ -257,8 +317,24 @@
257317
);
258318
runOnlyForDeploymentPostprocessing = 0;
259319
};
320+
5285BBA82B6408F500197CE7 /* Sources */ = {
321+
isa = PBXSourcesBuildPhase;
322+
buildActionMask = 2147483647;
323+
files = (
324+
5285BBAF2B6408F500197CE7 /* FlowStacksAppUITests.swift in Sources */,
325+
);
326+
runOnlyForDeploymentPostprocessing = 0;
327+
};
260328
/* End PBXSourcesBuildPhase section */
261329

330+
/* Begin PBXTargetDependency section */
331+
5285BBB32B6408F500197CE7 /* PBXTargetDependency */ = {
332+
isa = PBXTargetDependency;
333+
target = 5241BF3226AA1D3B002D6892 /* FlowStacksApp (iOS) */;
334+
targetProxy = 5285BBB22B6408F500197CE7 /* PBXContainerItemProxy */;
335+
};
336+
/* End PBXTargetDependency section */
337+
262338
/* Begin XCBuildConfiguration section */
263339
5241BF4026AA1D3B002D6892 /* Debug */ = {
264340
isa = XCBuildConfiguration;
@@ -502,6 +578,52 @@
502578
};
503579
name = Release;
504580
};
581+
5285BBB42B6408F500197CE7 /* Debug */ = {
582+
isa = XCBuildConfiguration;
583+
buildSettings = {
584+
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
585+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
586+
CODE_SIGN_STYLE = Automatic;
587+
CURRENT_PROJECT_VERSION = 1;
588+
GCC_C_LANGUAGE_STANDARD = gnu17;
589+
GENERATE_INFOPLIST_FILE = YES;
590+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
591+
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
592+
MARKETING_VERSION = 1.0;
593+
PRODUCT_BUNDLE_IDENTIFIER = co.uk.johnpatrickmorgan.FlowStacksAppUITests;
594+
PRODUCT_NAME = "$(TARGET_NAME)";
595+
SDKROOT = iphoneos;
596+
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
597+
SWIFT_EMIT_LOC_STRINGS = NO;
598+
SWIFT_VERSION = 5.0;
599+
TARGETED_DEVICE_FAMILY = "1,2";
600+
TEST_TARGET_NAME = "FlowStacksApp (iOS)";
601+
};
602+
name = Debug;
603+
};
604+
5285BBB52B6408F500197CE7 /* Release */ = {
605+
isa = XCBuildConfiguration;
606+
buildSettings = {
607+
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
608+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
609+
CODE_SIGN_STYLE = Automatic;
610+
CURRENT_PROJECT_VERSION = 1;
611+
GCC_C_LANGUAGE_STANDARD = gnu17;
612+
GENERATE_INFOPLIST_FILE = YES;
613+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
614+
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
615+
MARKETING_VERSION = 1.0;
616+
PRODUCT_BUNDLE_IDENTIFIER = co.uk.johnpatrickmorgan.FlowStacksAppUITests;
617+
PRODUCT_NAME = "$(TARGET_NAME)";
618+
SDKROOT = iphoneos;
619+
SWIFT_EMIT_LOC_STRINGS = NO;
620+
SWIFT_VERSION = 5.0;
621+
TARGETED_DEVICE_FAMILY = "1,2";
622+
TEST_TARGET_NAME = "FlowStacksApp (iOS)";
623+
VALIDATE_PRODUCT = YES;
624+
};
625+
name = Release;
626+
};
505627
/* End XCBuildConfiguration section */
506628

507629
/* Begin XCConfigurationList section */
@@ -532,6 +654,15 @@
532654
defaultConfigurationIsVisible = 0;
533655
defaultConfigurationName = Release;
534656
};
657+
5285BBB62B6408F500197CE7 /* Build configuration list for PBXNativeTarget "FlowStacksAppUITests" */ = {
658+
isa = XCConfigurationList;
659+
buildConfigurations = (
660+
5285BBB42B6408F500197CE7 /* Debug */,
661+
5285BBB52B6408F500197CE7 /* Release */,
662+
);
663+
defaultConfigurationIsVisible = 0;
664+
defaultConfigurationName = Release;
665+
};
535666
/* End XCConfigurationList section */
536667

537668
/* Begin XCRemoteSwiftPackageReference section */

FlowStacksApp.xcodeproj/xcshareddata/xcschemes/FlowStacksApp (iOS).xcscheme

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@
3838
ReferencedContainer = "container:">
3939
</BuildableReference>
4040
</TestableReference>
41+
<TestableReference
42+
skipped = "NO">
43+
<BuildableReference
44+
BuildableIdentifier = "primary"
45+
BlueprintIdentifier = "5285BBAB2B6408F500197CE7"
46+
BuildableName = "FlowStacksAppUITests.xctest"
47+
BlueprintName = "FlowStacksAppUITests"
48+
ReferencedContainer = "container:FlowStacksApp.xcodeproj">
49+
</BuildableReference>
50+
</TestableReference>
4151
</Testables>
4252
</TestAction>
4353
<LaunchAction

FlowStacksApp/Shared/NumberCoordinator.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,23 @@ struct NumberView: View {
7676
Button("Present Double (cover)") {
7777
navigator.presentCover(.number(number * 2), embedInNavigationView: true)
7878
}
79+
.accessibilityIdentifier("Present Double (cover) from \(number)")
7980
Button("Present Double (sheet)") {
8081
navigator.presentSheet(.number(number * 2), embedInNavigationView: true)
8182
}
83+
.accessibilityIdentifier("Present Double (sheet) from \(number)")
8284
Button("Push next") {
8385
navigator.push(.number(number + 1))
8486
}
87+
.accessibilityIdentifier("Push next from \(number)")
8588
if let goRandom = goRandom {
8689
Button("Go random", action: goRandom)
8790
}
8891
if navigator.routes.count > 1 {
8992
Button("Go back") { navigator.goBack() }
93+
.accessibilityIdentifier("Go back from \(number)")
9094
Button("Go back to root") { navigator.goBackToRoot() }
95+
.accessibilityIdentifier("Go back to root from \(number)")
9196
}
9297
}
9398
.padding()

FlowStacksApp/Shared/VMCoordinator.swift

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ class VMCoordinatorViewModel: ObservableObject {
1111
@Published var routes: Routes<Screen> = []
1212

1313
init() {
14-
routes.presentSheet(.home(.init(pickANumberSelected: showNumberList)))
14+
routes.presentSheet(.home(.init(pickANumberSelected: showNumberList)), embedInNavigationView: true)
1515
}
1616

1717
func showNumberList() {
18-
routes.presentSheet(.numberList(.init(numberSelected: showNumber, cancel: dismiss)))
18+
routes.push(.numberList(.init(numberSelected: showNumber, cancel: dismiss)))
1919
}
2020

2121
func showNumber(_ number: Int) {
22-
routes.presentSheet(.numberDetail(.init(number: number, cancel: goBackToRoot)))
22+
routes.presentSheet(.numberDetail(.init(number: number, cancel: goBackToRoot)), embedInNavigationView: true)
2323
}
2424

2525
func dismiss() {
@@ -111,13 +111,18 @@ struct NumberDetailView: View {
111111

112112
@Environment(\.presentationMode) var presentationMode
113113

114+
@EnvironmentObject var navigator: FlowNavigator<VMCoordinatorViewModel.Screen>
115+
114116
var body: some View {
115117
VStack {
116118
Text("\(viewModel.number)")
117119
Button("Go back to root", action: viewModel.cancel)
118120
Button("PresentationMode Dismiss") {
119121
presentationMode.wrappedValue.dismiss()
120122
}
123+
Button("Navigator Dismiss") {
124+
navigator.goBack()
125+
}
121126
}
122127
.navigationTitle("Number \(viewModel.number)")
123128
}

0 commit comments

Comments
 (0)