Skip to content

Commit 79d4916

Browse files
authored
Merge branch 'pointfreeco:main' into dynamic
2 parents e49989a + 526f70f commit 79d4916

File tree

153 files changed

+2099
-1656
lines changed

Some content is hidden

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

153 files changed

+2099
-1656
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ jobs:
1414
strategy:
1515
matrix:
1616
xcode:
17-
- 12.4
18-
- 12.5
19-
- '13.0'
17+
- '12.4'
18+
- '12.5.1'
19+
- '13.2.1'
2020
steps:
2121
- uses: actions/checkout@v2
2222
- name: Select Xcode ${{ matrix.xcode }}
2323
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
2424
- name: Run tests
2525
run: make test-library
2626
- name: Compile documentation
27-
if: ${{ matrix.xcode == '13.0' }}
27+
if: ${{ matrix.xcode == '13.2' }}
2828
run: make test-docs
2929
- name: Run benchmark
3030
run: make benchmark
@@ -34,9 +34,7 @@ jobs:
3434
strategy:
3535
matrix:
3636
xcode:
37-
- 12.4
38-
- 12.5
39-
- '13.0'
37+
- '13.2.1'
4038
steps:
4139
- uses: actions/checkout@v2
4240
- name: Select Xcode ${{ matrix.xcode }}

.spi.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
version: 1
22
builder:
33
configs:
4+
- platform: ios
5+
scheme: ComposableArchitecture
6+
- platform: macos-xcodebuild
7+
scheme: ComposableArchitecture
8+
- platform: macos-xcodebuild-arm
9+
scheme: ComposableArchitecture
10+
- platform: tvos
11+
scheme: ComposableArchitecture
412
- platform: watchos
513
scheme: ComposableArchitecture_watchOS

Examples/CaseStudies/CaseStudies.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
CA0C0C4724B89BEC00CBDD8A /* 04-HigherOrderReducers-LifecycleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA0C0C4624B89BEC00CBDD8A /* 04-HigherOrderReducers-LifecycleTests.swift */; };
1212
CA0C51FB245389CC00A04EAB /* 04-HigherOrderReducers-ReusableOfflineDownloadsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA0C51FA245389CC00A04EAB /* 04-HigherOrderReducers-ReusableOfflineDownloadsTests.swift */; };
1313
CA25E5D224463AD700DA666A /* 01-GettingStarted-Bindings-Basics.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA25E5D124463AD700DA666A /* 01-GettingStarted-Bindings-Basics.swift */; };
14-
CA27C0B7245780CE00CB1E59 /* 03-Effects-SystemEnvironment.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA27C0B6245780CE00CB1E59 /* 03-Effects-SystemEnvironment.swift */; };
14+
CA27C0B7245780CE00CB1E59 /* 02-Effects-SystemEnvironment.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA27C0B6245780CE00CB1E59 /* 02-Effects-SystemEnvironment.swift */; };
1515
CA34170824A4E89500FAF950 /* 01-GettingStarted-AnimationsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA34170724A4E89500FAF950 /* 01-GettingStarted-AnimationsTests.swift */; };
1616
CA3E421F26B8337500581ABC /* 01-GettingStarted-FocusState.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA3E421E26B8337500581ABC /* 01-GettingStarted-FocusState.swift */; };
1717
CA3E4C5B24B4FA0E00447C0B /* 04-HigherOrderReducers-Lifecycle.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA3E4C5A24B4FA0E00447C0B /* 04-HigherOrderReducers-Lifecycle.swift */; };
@@ -63,7 +63,6 @@
6363
DC630FDA2451016B00BAECBA /* ListsOfState.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC630FD92451016B00BAECBA /* ListsOfState.swift */; };
6464
DC634B252448D15B00DAA016 /* 04-HigherOrderReducers-ReusableFavoritingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC634B242448D15B00DAA016 /* 04-HigherOrderReducers-ReusableFavoritingTests.swift */; };
6565
DC88D8A6245341EC0077F427 /* 01-GettingStarted-Animations.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC88D8A5245341EC0077F427 /* 01-GettingStarted-Animations.swift */; };
66-
DC89C41924460F95006900B9 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC89C41824460F95006900B9 /* SceneDelegate.swift */; };
6766
DC89C41B24460F95006900B9 /* 00-RootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC89C41A24460F95006900B9 /* 00-RootView.swift */; };
6867
DC89C41D24460F96006900B9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DC89C41C24460F96006900B9 /* Assets.xcassets */; };
6968
DC89C4442446111B006900B9 /* 01-GettingStarted-Counter.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC89C4432446111B006900B9 /* 01-GettingStarted-Counter.swift */; };
@@ -80,6 +79,7 @@
8079
DCC68EE12447C4630037F998 /* 01-GettingStarted-Composition-TwoCounters.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCC68EE02447C4630037F998 /* 01-GettingStarted-Composition-TwoCounters.swift */; };
8180
DCC68EE32447C8540037F998 /* 04-HigherOrderReducers-ReusableFavoriting.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCC68EE22447C8540037F998 /* 04-HigherOrderReducers-ReusableFavoriting.swift */; };
8281
DCE63B71245CC0B90080A23D /* 04-HigherOrderReducers-Recursion.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCE63B70245CC0B90080A23D /* 04-HigherOrderReducers-Recursion.swift */; };
82+
DCFE1960278DBF0600C14CCF /* CaseStudiesApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCFE195F278DBF0600C14CCF /* CaseStudiesApp.swift */; };
8383
/* End PBXBuildFile section */
8484

8585
/* Begin PBXContainerItemProxy section */
@@ -154,7 +154,7 @@
154154
CA0C0C4624B89BEC00CBDD8A /* 04-HigherOrderReducers-LifecycleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "04-HigherOrderReducers-LifecycleTests.swift"; sourceTree = "<group>"; };
155155
CA0C51FA245389CC00A04EAB /* 04-HigherOrderReducers-ReusableOfflineDownloadsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "04-HigherOrderReducers-ReusableOfflineDownloadsTests.swift"; sourceTree = "<group>"; };
156156
CA25E5D124463AD700DA666A /* 01-GettingStarted-Bindings-Basics.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "01-GettingStarted-Bindings-Basics.swift"; sourceTree = "<group>"; };
157-
CA27C0B6245780CE00CB1E59 /* 03-Effects-SystemEnvironment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "03-Effects-SystemEnvironment.swift"; sourceTree = "<group>"; };
157+
CA27C0B6245780CE00CB1E59 /* 02-Effects-SystemEnvironment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "02-Effects-SystemEnvironment.swift"; sourceTree = "<group>"; };
158158
CA34170724A4E89500FAF950 /* 01-GettingStarted-AnimationsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "01-GettingStarted-AnimationsTests.swift"; sourceTree = "<group>"; };
159159
CA3E421E26B8337500581ABC /* 01-GettingStarted-FocusState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "01-GettingStarted-FocusState.swift"; sourceTree = "<group>"; };
160160
CA3E4C5A24B4FA0E00447C0B /* 04-HigherOrderReducers-Lifecycle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "04-HigherOrderReducers-Lifecycle.swift"; sourceTree = "<group>"; };
@@ -211,7 +211,6 @@
211211
DC634B242448D15B00DAA016 /* 04-HigherOrderReducers-ReusableFavoritingTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "04-HigherOrderReducers-ReusableFavoritingTests.swift"; sourceTree = "<group>"; };
212212
DC88D8A5245341EC0077F427 /* 01-GettingStarted-Animations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "01-GettingStarted-Animations.swift"; sourceTree = "<group>"; };
213213
DC89C41324460F95006900B9 /* SwiftUICaseStudies.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftUICaseStudies.app; sourceTree = BUILT_PRODUCTS_DIR; };
214-
DC89C41824460F95006900B9 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
215214
DC89C41A24460F95006900B9 /* 00-RootView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "00-RootView.swift"; sourceTree = "<group>"; };
216215
DC89C41C24460F96006900B9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
217216
DC89C42424460F96006900B9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
@@ -232,6 +231,7 @@
232231
DCC68EE02447C4630037F998 /* 01-GettingStarted-Composition-TwoCounters.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "01-GettingStarted-Composition-TwoCounters.swift"; sourceTree = "<group>"; };
233232
DCC68EE22447C8540037F998 /* 04-HigherOrderReducers-ReusableFavoriting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "04-HigherOrderReducers-ReusableFavoriting.swift"; sourceTree = "<group>"; };
234233
DCE63B70245CC0B90080A23D /* 04-HigherOrderReducers-Recursion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "04-HigherOrderReducers-Recursion.swift"; sourceTree = "<group>"; };
234+
DCFE195F278DBF0600C14CCF /* CaseStudiesApp.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CaseStudiesApp.swift; sourceTree = "<group>"; };
235235
/* End PBXFileReference section */
236236

237237
/* Begin PBXFrameworksBuildPhase section */
@@ -408,7 +408,7 @@
408408
CABC4F3826AEE00C00D5FA2C /* 02-Effects-Refreshable.swift */,
409409
DC89C45424465C44006900B9 /* 02-Effects-Timers.swift */,
410410
CA410EDF247A15FE00E41798 /* 02-Effects-WebSocket.swift */,
411-
CA27C0B6245780CE00CB1E59 /* 03-Effects-SystemEnvironment.swift */,
411+
CA27C0B6245780CE00CB1E59 /* 02-Effects-SystemEnvironment.swift */,
412412
DC89C45024462DE7006900B9 /* 03-Navigation-Lists-LoadThenNavigate.swift */,
413413
DC89C45224465451006900B9 /* 03-Navigation-Lists-NavigateAndLoad.swift */,
414414
DC89C448244618D5006900B9 /* 03-Navigation-LoadThenNavigate.swift */,
@@ -420,8 +420,8 @@
420420
DCE63B70245CC0B90080A23D /* 04-HigherOrderReducers-Recursion.swift */,
421421
DCC68EE22447C8540037F998 /* 04-HigherOrderReducers-ReusableFavoriting.swift */,
422422
DC2E370C24573ACB00B94699 /* 04-HigherOrderReducers-StrictReducers.swift */,
423+
DCFE195F278DBF0600C14CCF /* CaseStudiesApp.swift */,
423424
CA5ECF91267A79F0002067FF /* FactClient.swift */,
424-
DC89C41824460F95006900B9 /* SceneDelegate.swift */,
425425
DC89C41C24460F96006900B9 /* Assets.xcassets */,
426426
CA6AC25F2451131C00C71CB3 /* 04-HigherOrderReducers-ResuableOfflineDownloads */,
427427
DC89C44524461416006900B9 /* Internal */,
@@ -752,9 +752,9 @@
752752
DC2E370D24573ACB00B94699 /* 04-HigherOrderReducers-StrictReducers.swift in Sources */,
753753
CA5ECF92267A79F0002067FF /* FactClient.swift in Sources */,
754754
DC9EB4172450CBD2005F413B /* UIViewRepresented.swift in Sources */,
755-
DC89C41924460F95006900B9 /* SceneDelegate.swift in Sources */,
756755
CA6AC2652451135C00C71CB3 /* CircularProgressView.swift in Sources */,
757756
CA6AC2642451135C00C71CB3 /* ReusableComponents-Download.swift in Sources */,
757+
DCFE1960278DBF0600C14CCF /* CaseStudiesApp.swift in Sources */,
758758
CA6AC2662451135C00C71CB3 /* DownloadComponent.swift in Sources */,
759759
CA3E4C5B24B4FA0E00447C0B /* 04-HigherOrderReducers-Lifecycle.swift in Sources */,
760760
DC5B505125C86EBC000D8DFD /* 01-GettingStarted-Bindings-Forms.swift in Sources */,
@@ -769,7 +769,7 @@
769769
DC89C44D244621A5006900B9 /* 03-Navigation-NavigateAndLoad.swift in Sources */,
770770
DC89C4442446111B006900B9 /* 01-GettingStarted-Counter.swift in Sources */,
771771
DCE63B71245CC0B90080A23D /* 04-HigherOrderReducers-Recursion.swift in Sources */,
772-
CA27C0B7245780CE00CB1E59 /* 03-Effects-SystemEnvironment.swift in Sources */,
772+
CA27C0B7245780CE00CB1E59 /* 02-Effects-SystemEnvironment.swift in Sources */,
773773
CAA9ADCA2446605B0003A984 /* 02-Effects-LongLiving.swift in Sources */,
774774
DC89C45124462DE7006900B9 /* 03-Navigation-Lists-LoadThenNavigate.swift in Sources */,
775775
DC89C45524465C44006900B9 /* 02-Effects-Timers.swift in Sources */,
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1320"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "CAF88E6F24B8E26D00539345"
18+
BuildableName = "tvOSCaseStudies.app"
19+
BlueprintName = "tvOSCaseStudies"
20+
ReferencedContainer = "container:CaseStudies.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
<TestableReference
32+
skipped = "NO">
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "CAF88E8224B8E26E00539345"
36+
BuildableName = "tvOSCaseStudiesTests.xctest"
37+
BlueprintName = "tvOSCaseStudiesTests"
38+
ReferencedContainer = "container:CaseStudies.xcodeproj">
39+
</BuildableReference>
40+
</TestableReference>
41+
</Testables>
42+
</TestAction>
43+
<LaunchAction
44+
buildConfiguration = "Debug"
45+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
46+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
47+
launchStyle = "0"
48+
useCustomWorkingDirectory = "NO"
49+
ignoresPersistentStateOnLaunch = "NO"
50+
debugDocumentVersioning = "YES"
51+
debugServiceExtension = "internal"
52+
allowLocationSimulation = "YES">
53+
<BuildableProductRunnable
54+
runnableDebuggingMode = "0">
55+
<BuildableReference
56+
BuildableIdentifier = "primary"
57+
BlueprintIdentifier = "CAF88E6F24B8E26D00539345"
58+
BuildableName = "tvOSCaseStudies.app"
59+
BlueprintName = "tvOSCaseStudies"
60+
ReferencedContainer = "container:CaseStudies.xcodeproj">
61+
</BuildableReference>
62+
</BuildableProductRunnable>
63+
</LaunchAction>
64+
<ProfileAction
65+
buildConfiguration = "Release"
66+
shouldUseLaunchSchemeArgsEnv = "YES"
67+
savedToolIdentifier = ""
68+
useCustomWorkingDirectory = "NO"
69+
debugDocumentVersioning = "YES">
70+
<BuildableProductRunnable
71+
runnableDebuggingMode = "0">
72+
<BuildableReference
73+
BuildableIdentifier = "primary"
74+
BlueprintIdentifier = "CAF88E6F24B8E26D00539345"
75+
BuildableName = "tvOSCaseStudies.app"
76+
BlueprintName = "tvOSCaseStudies"
77+
ReferencedContainer = "container:CaseStudies.xcodeproj">
78+
</BuildableReference>
79+
</BuildableProductRunnable>
80+
</ProfileAction>
81+
<AnalyzeAction
82+
buildConfiguration = "Debug">
83+
</AnalyzeAction>
84+
<ArchiveAction
85+
buildConfiguration = "Release"
86+
revealArchiveInOrganizer = "YES">
87+
</ArchiveAction>
88+
</Scheme>

Examples/CaseStudies/SwiftUICaseStudies/01-GettingStarted-AlertsAndConfirmationDialogs.swift

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,22 +91,20 @@ struct AlertAndConfirmationDialogView: View {
9191
Form {
9292
Section(header: Text(template: readMe, .caption)) {
9393
Text("Count: \(viewStore.count)")
94-
9594
Button("Alert") { viewStore.send(.alertButtonTapped) }
96-
.alert(
97-
self.store.scope(state: \.alert),
98-
dismiss: .alertDismissed
99-
)
100-
10195
Button("Confirmation Dialog") { viewStore.send(.confirmationDialogButtonTapped) }
102-
.confirmationDialog(
103-
self.store.scope(state: \.confirmationDialog),
104-
dismiss: .confirmationDialogDismissed
105-
)
10696
}
10797
}
10898
}
10999
.navigationBarTitle("Alerts & Confirmation Dialogs")
100+
.alert(
101+
self.store.scope(state: \.alert),
102+
dismiss: .alertDismissed
103+
)
104+
.confirmationDialog(
105+
self.store.scope(state: \.confirmationDialog),
106+
dismiss: .confirmationDialogDismissed
107+
)
110108
}
111109
}
112110

Examples/CaseStudies/SwiftUICaseStudies/01-GettingStarted-Animations.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ struct AnimationsView: View {
108108
let store: Store<AnimationsState, AnimationsAction>
109109

110110
var body: some View {
111-
GeometryReader { proxy in
112-
WithViewStore(self.store) { viewStore in
111+
WithViewStore(self.store) { viewStore in
112+
GeometryReader { proxy in
113113
VStack(alignment: .leading) {
114114
ZStack(alignment: .center) {
115115
Text(template: readMe, .body)
@@ -144,9 +144,9 @@ struct AnimationsView: View {
144144
)
145145
.padding()
146146
Button("Rainbow") { viewStore.send(.rainbowButtonTapped, animation: .linear) }
147-
.padding([.leading, .trailing, .bottom])
147+
.padding([.horizontal, .bottom])
148148
Button("Reset") { viewStore.send(.resetButtonTapped) }
149-
.padding([.leading, .trailing, .bottom])
149+
.padding([.horizontal, .bottom])
150150
}
151151
.alert(self.store.scope(state: \.alert), dismiss: .dismissAlert)
152152
}

Examples/CaseStudies/SwiftUICaseStudies/01-GettingStarted-Bindings-Basics.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ struct BindingBasicsState: Equatable {
2929
enum BindingBasicsAction {
3030
case sliderValueChanged(Double)
3131
case stepCountChanged(Int)
32-
case textChange(String)
33-
case toggleChange(isOn: Bool)
32+
case textChanged(String)
33+
case toggleChanged(isOn: Bool)
3434
}
3535

3636
struct BindingBasicsEnvironment {}
@@ -49,11 +49,11 @@ let bindingBasicsReducer = Reducer<
4949
state.stepCount = count
5050
return .none
5151

52-
case let .textChange(text):
52+
case let .textChanged(text):
5353
state.text = text
5454
return .none
5555

56-
case let .toggleChange(isOn):
56+
case let .toggleChanged(isOn):
5757
state.toggleIsOn = isOn
5858
return .none
5959
}
@@ -69,7 +69,7 @@ struct BindingBasicsView: View {
6969
HStack {
7070
TextField(
7171
"Type here",
72-
text: viewStore.binding(get: \.text, send: BindingBasicsAction.textChange)
72+
text: viewStore.binding(get: \.text, send: BindingBasicsAction.textChanged)
7373
)
7474
.disableAutocorrection(true)
7575
.foregroundColor(viewStore.toggleIsOn ? .gray : .primary)
@@ -78,7 +78,7 @@ struct BindingBasicsView: View {
7878
.disabled(viewStore.toggleIsOn)
7979

8080
Toggle(
81-
isOn: viewStore.binding(get: \.toggleIsOn, send: BindingBasicsAction.toggleChange)
81+
isOn: viewStore.binding(get: \.toggleIsOn, send: BindingBasicsAction.toggleChanged)
8282
) {
8383
Text("Disable other controls")
8484
}
@@ -89,13 +89,13 @@ struct BindingBasicsView: View {
8989
in: 0...100
9090
) {
9191
Text("Max slider value: \(viewStore.stepCount)")
92-
.font(Font.body.monospacedDigit())
92+
.font(.body.monospacedDigit())
9393
}
9494
.disabled(viewStore.toggleIsOn)
9595

9696
HStack {
9797
Text("Slider value: \(Int(viewStore.sliderValue))")
98-
.font(Font.body.monospacedDigit())
98+
.font(.body.monospacedDigit())
9999
Slider(
100100
value: viewStore.binding(
101101
get: \.sliderValue,

Examples/CaseStudies/SwiftUICaseStudies/01-GettingStarted-Bindings-Forms.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,22 @@
6868

6969
Stepper(value: viewStore.binding(\.$stepCount), in: 0...100) {
7070
Text("Max slider value: \(viewStore.stepCount)")
71-
.font(Font.body.monospacedDigit())
71+
.font(.body.monospacedDigit())
7272
}
7373
.disabled(viewStore.toggleIsOn)
7474

7575
HStack {
7676
Text("Slider value: \(Int(viewStore.sliderValue))")
77-
.font(Font.body.monospacedDigit())
77+
.font(.body.monospacedDigit())
7878

7979
Slider(value: viewStore.binding(\.$sliderValue), in: 0...Double(viewStore.stepCount))
8080
}
8181
.disabled(viewStore.toggleIsOn)
82+
83+
Button("Reset") {
84+
viewStore.send(.resetButtonTapped)
85+
}
86+
.foregroundColor(.red)
8287
}
8388
}
8489
}

0 commit comments

Comments
 (0)