Skip to content

Commit e71582d

Browse files
Merge pull request #9 from johnpatrickmorgan/feature/new-features
Add new 0.1 features
2 parents e30add3 + 4a82041 commit e71582d

31 files changed

+1981
-773
lines changed

.swift-format.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"fileScopedDeclarationPrivacy" : {
3+
"accessLevel" : "private"
4+
},
5+
"indentation" : {
6+
"spaces" : 2
7+
},
8+
"indentConditionalCompilationBlocks" : true,
9+
"indentSwitchCaseLabels" : false,
10+
"lineBreakAroundMultilineExpressionChainComponents" : false,
11+
"lineBreakBeforeControlFlowKeywords" : false,
12+
"lineBreakBeforeEachArgument" : false,
13+
"lineBreakBeforeEachGenericRequirement" : false,
14+
"lineLength" : 100,
15+
"maximumBlankLines" : 1,
16+
"prioritizeKeepingFunctionOutputTogether" : false,
17+
"respectsExistingLineBreaks" : true,
18+
"rules" : {
19+
"AllPublicDeclarationsHaveDocumentation" : false,
20+
"AlwaysUseLowerCamelCase" : true,
21+
"AmbiguousTrailingClosureOverload" : true,
22+
"BeginDocumentationCommentWithOneLineSummary" : false,
23+
"DoNotUseSemicolons" : true,
24+
"DontRepeatTypeInStaticProperties" : true,
25+
"FileScopedDeclarationPrivacy" : true,
26+
"FullyIndirectEnum" : true,
27+
"GroupNumericLiterals" : true,
28+
"IdentifiersMustBeASCII" : true,
29+
"NeverForceUnwrap" : false,
30+
"NeverUseForceTry" : false,
31+
"NeverUseImplicitlyUnwrappedOptionals" : false,
32+
"NoAccessLevelOnExtensionDeclaration" : false,
33+
"NoBlockComments" : true,
34+
"NoCasesWithOnlyFallthrough" : true,
35+
"NoEmptyTrailingClosureParentheses" : true,
36+
"NoLabelsInCasePatterns" : true,
37+
"NoLeadingUnderscores" : false,
38+
"NoParensAroundConditions" : true,
39+
"NoVoidReturnOnFunctionSignature" : true,
40+
"OneCasePerLine" : true,
41+
"OneVariableDeclarationPerLine" : true,
42+
"OnlyOneTrailingClosureArgument" : true,
43+
"OrderedImports" : false,
44+
"ReturnVoidInsteadOfEmptyTuple" : true,
45+
"UseLetInEveryBoundCaseVariable" : true,
46+
"UseShorthandTypeNames" : true,
47+
"UseSingleLinePropertyGetter" : true,
48+
"UseSynthesizedInitializer" : true,
49+
"UseTripleSlashForDocumentationComments" : true,
50+
"ValidateDocumentationComments" : false
51+
},
52+
"tabWidth" : 8,
53+
"version" : 1
54+
}

FlowStacksApp.xcodeproj/project.pbxproj

Lines changed: 54 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99
/* Begin PBXBuildFile section */
1010
5241BF6F26AA1E8A002D6892 /* FlowStacks in Frameworks */ = {isa = PBXBuildFile; productRef = 5241BF6E26AA1E8A002D6892 /* FlowStacks */; };
1111
5241BF7126AA1E8F002D6892 /* FlowStacks in Frameworks */ = {isa = PBXBuildFile; productRef = 5241BF7026AA1E8F002D6892 /* FlowStacks */; };
12+
525C733527729300009CBD67 /* SwiftUINavigation in Frameworks */ = {isa = PBXBuildFile; productRef = 525C733427729300009CBD67 /* SwiftUINavigation */; };
13+
525C73372774BA6B009CBD67 /* NumberCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525C73362774BA6B009CBD67 /* NumberCoordinator.swift */; };
14+
525C73382774BA6B009CBD67 /* NumberCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525C73362774BA6B009CBD67 /* NumberCoordinator.swift */; };
15+
525C733A2774BDB7009CBD67 /* BindingCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525C73392774BDB7009CBD67 /* BindingCoordinator.swift */; };
16+
525C733B2774BDB7009CBD67 /* BindingCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525C73392774BDB7009CBD67 /* BindingCoordinator.swift */; };
17+
525C7341277BC788009CBD67 /* ShowingCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525C7340277BC788009CBD67 /* ShowingCoordinator.swift */; };
18+
525C7342277BC788009CBD67 /* ShowingCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525C7340277BC788009CBD67 /* ShowingCoordinator.swift */; };
19+
525C7344277BCDDA009CBD67 /* SwiftUINavigation in Frameworks */ = {isa = PBXBuildFile; productRef = 525C7343277BCDDA009CBD67 /* SwiftUINavigation */; };
1220
526D9F2426AF661F00B6B882 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 526D9F1C26AF661F00B6B882 /* Assets.xcassets */; };
1321
526D9F2526AF661F00B6B882 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 526D9F1C26AF661F00B6B882 /* Assets.xcassets */; };
14-
526D9F2626AF661F00B6B882 /* VMNCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 526D9F1E26AF661F00B6B882 /* VMNCoordinator.swift */; };
15-
526D9F2726AF661F00B6B882 /* VMNCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 526D9F1E26AF661F00B6B882 /* VMNCoordinator.swift */; };
16-
526D9F2A26AF661F00B6B882 /* NumberNCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 526D9F2026AF661F00B6B882 /* NumberNCoordinator.swift */; };
17-
526D9F2B26AF661F00B6B882 /* NumberNCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 526D9F2026AF661F00B6B882 /* NumberNCoordinator.swift */; };
18-
526D9F2C26AF661F00B6B882 /* NumberPCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 526D9F2126AF661F00B6B882 /* NumberPCoordinator.swift */; };
19-
526D9F2D26AF661F00B6B882 /* NumberPCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 526D9F2126AF661F00B6B882 /* NumberPCoordinator.swift */; };
20-
526D9F2E26AF661F00B6B882 /* VMPCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 526D9F2226AF661F00B6B882 /* VMPCoordinator.swift */; };
21-
526D9F2F26AF661F00B6B882 /* VMPCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 526D9F2226AF661F00B6B882 /* VMPCoordinator.swift */; };
22-
526D9F3026AF661F00B6B882 /* MixedCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 526D9F2326AF661F00B6B882 /* MixedCoordinator.swift */; };
23-
526D9F3126AF661F00B6B882 /* MixedCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 526D9F2326AF661F00B6B882 /* MixedCoordinator.swift */; };
22+
526D9F2E26AF661F00B6B882 /* VMCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 526D9F2226AF661F00B6B882 /* VMCoordinator.swift */; };
23+
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 */; };
2626
526D9F7B26AF6C1700B6B882 /* in Resources */ = {isa = PBXBuildFile; fileRef = 526D9F7A26AF6BE900B6B882 /* */; };
@@ -30,12 +30,11 @@
3030
/* Begin PBXFileReference section */
3131
5241BF3326AA1D3B002D6892 /* FlowStacksApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FlowStacksApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
3232
5241BF3926AA1D3B002D6892 /* FlowStacksApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FlowStacksApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
33+
525C73362774BA6B009CBD67 /* NumberCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NumberCoordinator.swift; sourceTree = "<group>"; };
34+
525C73392774BDB7009CBD67 /* BindingCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BindingCoordinator.swift; sourceTree = "<group>"; };
35+
525C7340277BC788009CBD67 /* ShowingCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShowingCoordinator.swift; sourceTree = "<group>"; };
3336
526D9F1C26AF661F00B6B882 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
34-
526D9F1E26AF661F00B6B882 /* VMNCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VMNCoordinator.swift; sourceTree = "<group>"; };
35-
526D9F2026AF661F00B6B882 /* NumberNCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NumberNCoordinator.swift; sourceTree = "<group>"; };
36-
526D9F2126AF661F00B6B882 /* NumberPCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NumberPCoordinator.swift; sourceTree = "<group>"; };
37-
526D9F2226AF661F00B6B882 /* VMPCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VMPCoordinator.swift; sourceTree = "<group>"; };
38-
526D9F2326AF661F00B6B882 /* MixedCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MixedCoordinator.swift; sourceTree = "<group>"; };
37+
526D9F2226AF661F00B6B882 /* VMCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VMCoordinator.swift; sourceTree = "<group>"; };
3938
526D9F3226AF667000B6B882 /* FlowStacksApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlowStacksApp.swift; sourceTree = "<group>"; };
4039
526D9F7A26AF6BE900B6B882 /* */ = {isa = PBXFileReference; lastKnownFileType = folder; name = ""; sourceTree = "<group>"; };
4140
/* End PBXFileReference section */
@@ -45,6 +44,7 @@
4544
isa = PBXFrameworksBuildPhase;
4645
buildActionMask = 2147483647;
4746
files = (
47+
525C733527729300009CBD67 /* SwiftUINavigation in Frameworks */,
4848
5241BF7126AA1E8F002D6892 /* FlowStacks in Frameworks */,
4949
);
5050
runOnlyForDeploymentPostprocessing = 0;
@@ -53,6 +53,7 @@
5353
isa = PBXFrameworksBuildPhase;
5454
buildActionMask = 2147483647;
5555
files = (
56+
525C7344277BCDDA009CBD67 /* SwiftUINavigation in Frameworks */,
5657
5241BF6F26AA1E8A002D6892 /* FlowStacks in Frameworks */,
5758
);
5859
runOnlyForDeploymentPostprocessing = 0;
@@ -99,11 +100,10 @@
99100
isa = PBXGroup;
100101
children = (
101102
526D9F3226AF667000B6B882 /* FlowStacksApp.swift */,
102-
526D9F1E26AF661F00B6B882 /* VMNCoordinator.swift */,
103-
526D9F2026AF661F00B6B882 /* NumberNCoordinator.swift */,
104-
526D9F2126AF661F00B6B882 /* NumberPCoordinator.swift */,
105-
526D9F2226AF661F00B6B882 /* VMPCoordinator.swift */,
106-
526D9F2326AF661F00B6B882 /* MixedCoordinator.swift */,
103+
525C73362774BA6B009CBD67 /* NumberCoordinator.swift */,
104+
526D9F2226AF661F00B6B882 /* VMCoordinator.swift */,
105+
525C7340277BC788009CBD67 /* ShowingCoordinator.swift */,
106+
525C73392774BDB7009CBD67 /* BindingCoordinator.swift */,
107107
);
108108
path = Shared;
109109
sourceTree = "<group>";
@@ -126,6 +126,7 @@
126126
name = "FlowStacksApp (iOS)";
127127
packageProductDependencies = (
128128
5241BF7026AA1E8F002D6892 /* FlowStacks */,
129+
525C733427729300009CBD67 /* SwiftUINavigation */,
129130
);
130131
productName = "FlowStacksApp (iOS)";
131132
productReference = 5241BF3326AA1D3B002D6892 /* FlowStacksApp.app */;
@@ -146,6 +147,7 @@
146147
name = "FlowStacksApp (macOS)";
147148
packageProductDependencies = (
148149
5241BF6E26AA1E8A002D6892 /* FlowStacks */,
150+
525C7343277BCDDA009CBD67 /* SwiftUINavigation */,
149151
);
150152
productName = "FlowStacksApp (macOS)";
151153
productReference = 5241BF3926AA1D3B002D6892 /* FlowStacksApp.app */;
@@ -178,6 +180,9 @@
178180
Base,
179181
);
180182
mainGroup = 5241BF2626AA1D3A002D6892;
183+
packageReferences = (
184+
525C733327729300009CBD67 /* XCRemoteSwiftPackageReference "swiftui-navigation" */,
185+
);
181186
productRefGroup = 5241BF3426AA1D3B002D6892 /* Products */;
182187
projectDirPath = "";
183188
projectRoot = "";
@@ -215,11 +220,10 @@
215220
buildActionMask = 2147483647;
216221
files = (
217222
526D9F3326AF667000B6B882 /* FlowStacksApp.swift in Sources */,
218-
526D9F2E26AF661F00B6B882 /* VMPCoordinator.swift in Sources */,
219-
526D9F2C26AF661F00B6B882 /* NumberPCoordinator.swift in Sources */,
220-
526D9F3026AF661F00B6B882 /* MixedCoordinator.swift in Sources */,
221-
526D9F2A26AF661F00B6B882 /* NumberNCoordinator.swift in Sources */,
222-
526D9F2626AF661F00B6B882 /* VMNCoordinator.swift in Sources */,
223+
526D9F2E26AF661F00B6B882 /* VMCoordinator.swift in Sources */,
224+
525C733A2774BDB7009CBD67 /* BindingCoordinator.swift in Sources */,
225+
525C73372774BA6B009CBD67 /* NumberCoordinator.swift in Sources */,
226+
525C7341277BC788009CBD67 /* ShowingCoordinator.swift in Sources */,
223227
);
224228
runOnlyForDeploymentPostprocessing = 0;
225229
};
@@ -228,11 +232,10 @@
228232
buildActionMask = 2147483647;
229233
files = (
230234
526D9F3426AF667000B6B882 /* FlowStacksApp.swift in Sources */,
231-
526D9F2F26AF661F00B6B882 /* VMPCoordinator.swift in Sources */,
232-
526D9F2D26AF661F00B6B882 /* NumberPCoordinator.swift in Sources */,
233-
526D9F3126AF661F00B6B882 /* MixedCoordinator.swift in Sources */,
234-
526D9F2B26AF661F00B6B882 /* NumberNCoordinator.swift in Sources */,
235-
526D9F2726AF661F00B6B882 /* VMNCoordinator.swift in Sources */,
235+
526D9F2F26AF661F00B6B882 /* VMCoordinator.swift in Sources */,
236+
525C733B2774BDB7009CBD67 /* BindingCoordinator.swift in Sources */,
237+
525C73382774BA6B009CBD67 /* NumberCoordinator.swift in Sources */,
238+
525C7342277BC788009CBD67 /* ShowingCoordinator.swift in Sources */,
236239
);
237240
runOnlyForDeploymentPostprocessing = 0;
238241
};
@@ -501,6 +504,17 @@
501504
};
502505
/* End XCConfigurationList section */
503506

507+
/* Begin XCRemoteSwiftPackageReference section */
508+
525C733327729300009CBD67 /* XCRemoteSwiftPackageReference "swiftui-navigation" */ = {
509+
isa = XCRemoteSwiftPackageReference;
510+
repositoryURL = "https://github.com/pointfreeco/swiftui-navigation";
511+
requirement = {
512+
kind = upToNextMajorVersion;
513+
minimumVersion = 0.1.0;
514+
};
515+
};
516+
/* End XCRemoteSwiftPackageReference section */
517+
504518
/* Begin XCSwiftPackageProductDependency section */
505519
5241BF6E26AA1E8A002D6892 /* FlowStacks */ = {
506520
isa = XCSwiftPackageProductDependency;
@@ -510,6 +524,16 @@
510524
isa = XCSwiftPackageProductDependency;
511525
productName = FlowStacks;
512526
};
527+
525C733427729300009CBD67 /* SwiftUINavigation */ = {
528+
isa = XCSwiftPackageProductDependency;
529+
package = 525C733327729300009CBD67 /* XCRemoteSwiftPackageReference "swiftui-navigation" */;
530+
productName = SwiftUINavigation;
531+
};
532+
525C7343277BCDDA009CBD67 /* SwiftUINavigation */ = {
533+
isa = XCSwiftPackageProductDependency;
534+
package = 525C733327729300009CBD67 /* XCRemoteSwiftPackageReference "swiftui-navigation" */;
535+
productName = SwiftUINavigation;
536+
};
513537
/* End XCSwiftPackageProductDependency section */
514538
};
515539
rootObject = 5241BF2726AA1D3A002D6892 /* Project object */;

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
2929
shouldUseLaunchSchemeArgsEnv = "YES">
3030
<Testables>
31+
<TestableReference
32+
skipped = "NO">
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "FlowStacksTests"
36+
BuildableName = "FlowStacksTests"
37+
BlueprintName = "FlowStacksTests"
38+
ReferencedContainer = "container:">
39+
</BuildableReference>
40+
</TestableReference>
3141
</Testables>
3242
</TestAction>
3343
<LaunchAction
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import Foundation
2+
import SwiftUI
3+
import FlowStacks
4+
import SwiftUINavigation
5+
6+
struct BindingCoordinator: View {
7+
enum Screen {
8+
case start
9+
case number(Int)
10+
}
11+
12+
@State var routes: Routes<Screen> = [.root(.start, embedInNavigationView: true)]
13+
14+
var body: some View {
15+
Router($routes) { $screen, _ in
16+
if let number = Binding(unwrapping: $screen, case: /Screen.number) {
17+
// Here number is a Binding<Int>, so NumberView can change its
18+
// value in the routes array.
19+
EditableNumberView(number: number)
20+
} else {
21+
StartView(goTapped: goTapped)
22+
}
23+
}
24+
}
25+
26+
func goTapped() {
27+
routes.push(.number(42))
28+
}
29+
}
30+
31+
struct StartView: View {
32+
33+
let goTapped: () -> Void
34+
35+
var body: some View {
36+
VStack(alignment: .center, spacing: 8) {
37+
Button("Go", action: goTapped)
38+
}.navigationTitle("Home")
39+
}
40+
}
41+
42+
struct EditableNumberView: View {
43+
44+
@Binding var number: Int
45+
46+
var body: some View {
47+
VStack(alignment: .center, spacing: 8) {
48+
Stepper("\(number)", onIncrement: { number += 1 }, onDecrement: { number -= 1 })
49+
}
50+
.padding()
51+
.navigationTitle("\(number)")
52+
}
53+
}

FlowStacksApp/Shared/FlowStacksApp.swift

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@ import SwiftUI
22

33
@main
44
struct FlowStacksApp: App {
5-
var body: some Scene {
6-
WindowGroup {
7-
// NumberPCoordinator()
8-
// MixedCoordinator()
9-
// VMCoordinator(viewModel: .init())
10-
// VMPCoordinator(viewModel: .init())
11-
NavigationView {
12-
NumberNCoordinator()
13-
}
14-
}
5+
var body: some Scene {
6+
WindowGroup {
7+
TabView {
8+
NumberCoordinator()
9+
.tabItem { Text("Numbers") }
10+
VMCoordinator()
11+
.tabItem { Text("VMs") }
12+
BindingCoordinator()
13+
.tabItem { Text("Binding") }
14+
ShowingCoordinator()
15+
.tabItem { Text("Showing") }
16+
}
1517
}
18+
}
1619
}

FlowStacksApp/Shared/MixedCoordinator.swift

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

0 commit comments

Comments
 (0)