Skip to content

Commit f1394f1

Browse files
mluisbrownactions-user
authored andcommitted
Run swift-format
1 parent 68287a5 commit f1394f1

File tree

18 files changed

+1065
-1062
lines changed

18 files changed

+1065
-1062
lines changed

Examples/CaseStudies/SwiftUICaseStudies/00-Core.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ let rootReducer = Reducer<RootState, RootAction, RootEnvironment>.combine(
155155
.pullback(
156156
state: \.lifecycle,
157157
action: /RootAction.lifecycle,
158-
environment: { .init(mainQueue: $0.mainQueue )}
158+
environment: { .init(mainQueue: $0.mainQueue) }
159159
),
160160
loadThenNavigateReducer
161161
.pullback(

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ extension Effect where Error == Never {
2424
) -> Effect {
2525
.concatenate(
2626
values
27-
.enumerated()
28-
.map { index, animationState in
29-
index == 0
30-
? Effect(value: animationState.output)
31-
: Effect(value: animationState.output)
32-
.delay(values[index - 1].duration, on: scheduler)
33-
}
27+
.enumerated()
28+
.map { index, animationState in
29+
index == 0
30+
? Effect(value: animationState.output)
31+
: Effect(value: animationState.output)
32+
.delay(values[index - 1].duration, on: scheduler)
33+
}
3434
)
3535
}
3636
}
@@ -62,9 +62,9 @@ let animationsReducer = Reducer<AnimationsState, AnimationsAction, AnimationsEnv
6262

6363
case .rainbowButtonTapped:
6464
return .keyFrames(
65-
values: [Color.red, .blue, .green, .orange, .pink, .purple, .yellow, .white]
66-
.map { (output: .setColor($0), duration: 1) },
67-
scheduler: environment.mainQueue
65+
values: [Color.red, .blue, .green, .orange, .pink, .purple, .yellow, .white]
66+
.map { (output: .setColor($0), duration: 1) },
67+
scheduler: environment.mainQueue
6868
)
6969

7070
case let .setColor(color):

Examples/CaseStudies/SwiftUICaseStudies/04-HigherOrderReducers-Lifecycle.swift

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ struct LifecycleDemoEnvironment {
5656
var mainQueue: DateScheduler
5757
}
5858

59-
let lifecycleDemoReducer: Reducer<LifecycleDemoState, LifecycleDemoAction, LifecycleDemoEnvironment>
60-
= .combine(
59+
let lifecycleDemoReducer:
60+
Reducer<LifecycleDemoState, LifecycleDemoAction, LifecycleDemoEnvironment> = .combine(
6161
timerReducer.pullback(
6262
state: \.count,
6363
action: /LifecycleDemoAction.timer,
@@ -73,7 +73,7 @@ let lifecycleDemoReducer: Reducer<LifecycleDemoState, LifecycleDemoAction, Lifec
7373
return .none
7474
}
7575
}
76-
)
76+
)
7777

7878
struct LifecycleDemoView: View {
7979
let store: Store<LifecycleDemoState, LifecycleDemoAction>
@@ -107,7 +107,8 @@ struct TimerEnvironment {
107107
var mainQueue: DateScheduler
108108
}
109109

110-
private let timerReducer = Reducer<Int, TimerAction, TimerEnvironment> { state, action, TimerEnvironment in
110+
private let timerReducer = Reducer<Int, TimerAction, TimerEnvironment> {
111+
state, action, TimerEnvironment in
111112
switch action {
112113
case .decrementButtonTapped:
113114
state -= 1
@@ -126,10 +127,10 @@ private let timerReducer = Reducer<Int, TimerAction, TimerEnvironment> { state,
126127
onAppear: {
127128
Effect.timer(id: TimerId(), every: .seconds(1), tolerance: .seconds(0), on: $0.mainQueue)
128129
.map { _ in TimerAction.tick }
129-
},
130+
},
130131
onDisappear: { _ in
131132
.cancel(id: TimerId())
132-
})
133+
})
133134

134135
private struct TimerView: View {
135136
let store: Store<Int, LifecycleAction<TimerAction>>
@@ -141,7 +142,7 @@ private struct TimerView: View {
141142
.onAppear { viewStore.send(.onAppear) }
142143
.onDisappear { viewStore.send(.onDisappear) }
143144

144-
Button("Decrement") { viewStore.send(.action(.decrementButtonTapped))}
145+
Button("Decrement") { viewStore.send(.action(.decrementButtonTapped)) }
145146

146147
Button("Increment") { viewStore.send(.action(.incrementButtonTapped)) }
147148
}

Examples/CaseStudies/tvOSCaseStudies/AppDelegate.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import UIKit
55
@UIApplicationMain
66
class AppDelegate: UIResponder, UIApplicationDelegate {
77
var window: UIWindow?
8-
8+
99
func application(
1010
_ application: UIApplication,
1111
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
@@ -17,7 +17,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1717
environment: .init()
1818
)
1919
)
20-
20+
2121
let window = UIWindow(frame: UIScreen.main.bounds)
2222
window.rootViewController = UIHostingController(rootView: contentView)
2323
self.window = window

Examples/CaseStudies/tvOSCaseStudies/FocusView.swift

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ struct FocusEnvironment {
2222
var randomElement: () -> Int = { (1..<11).randomElement()! }
2323
}
2424

25-
let focusReducer = Reducer<FocusState, FocusAction, FocusEnvironment> { state, action, environment in
25+
let focusReducer = Reducer<FocusState, FocusAction, FocusEnvironment> {
26+
state, action, environment in
2627
switch action {
2728
case .randomButtonClicked:
2829
state.currentFocus = environment.randomElement()
@@ -31,51 +32,51 @@ let focusReducer = Reducer<FocusState, FocusAction, FocusEnvironment> { state, a
3132
}
3233

3334
#if swift(>=5.3)
34-
@available(tvOS 14.0, *)
35-
struct FocusView: View {
36-
let store: Store<FocusState, FocusAction>
35+
@available(tvOS 14.0, *)
36+
struct FocusView: View {
37+
let store: Store<FocusState, FocusAction>
3738

38-
@Environment(\.resetFocus) var resetFocus
39-
@Namespace private var namespace
39+
@Environment(\.resetFocus) var resetFocus
40+
@Namespace private var namespace
4041

41-
var body: some View {
42-
WithViewStore(self.store) { viewStore in
43-
VStack(spacing: 100) {
44-
Text(readMe)
45-
.font(.headline)
46-
.multilineTextAlignment(.leading)
47-
.padding()
42+
var body: some View {
43+
WithViewStore(self.store) { viewStore in
44+
VStack(spacing: 100) {
45+
Text(readMe)
46+
.font(.headline)
47+
.multilineTextAlignment(.leading)
48+
.padding()
4849

49-
HStack(spacing: 40) {
50-
ForEach(1..<11) { index in
51-
Button(numbers[index]) {}
52-
.prefersDefaultFocus(viewStore.currentFocus == index, in: self.namespace)
50+
HStack(spacing: 40) {
51+
ForEach(1..<11) { index in
52+
Button(numbers[index]) {}
53+
.prefersDefaultFocus(viewStore.currentFocus == index, in: self.namespace)
54+
}
5355
}
54-
}
5556

56-
Button("Focus Random") { viewStore.send(.randomButtonClicked) }
57-
}
58-
.onChange(of: viewStore.currentFocus) { _ in
59-
// Update the view's focus when the state tells us the focus changed.
60-
self.resetFocus(in: self.namespace)
57+
Button("Focus Random") { viewStore.send(.randomButtonClicked) }
58+
}
59+
.onChange(of: viewStore.currentFocus) { _ in
60+
// Update the view's focus when the state tells us the focus changed.
61+
self.resetFocus(in: self.namespace)
62+
}
63+
.focusScope(self.namespace)
6164
}
62-
.focusScope(self.namespace)
6365
}
6466
}
65-
}
6667

67-
@available(tvOS 14.0, *)
68-
struct FocusView_Previews: PreviewProvider {
69-
static var previews: some View {
70-
FocusView(
71-
store: .init(
72-
initialState: .init(),
73-
reducer: focusReducer,
74-
environment: .init()
68+
@available(tvOS 14.0, *)
69+
struct FocusView_Previews: PreviewProvider {
70+
static var previews: some View {
71+
FocusView(
72+
store: .init(
73+
initialState: .init(),
74+
reducer: focusReducer,
75+
environment: .init()
76+
)
7577
)
76-
)
78+
}
7779
}
78-
}
7980
#endif
8081

8182
private let numbers = [
@@ -89,5 +90,5 @@ private let numbers = [
8990
"Seven",
9091
"Eight",
9192
"Nine",
92-
"Ten"
93+
"Ten",
9394
]

Examples/CaseStudies/tvOSCaseStudies/RootView.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import SwiftUI
33

44
struct RootView: View {
55
let store: Store<RootState, RootAction>
6-
6+
77
var body: some View {
88
NavigationView {
99
Form {
@@ -13,21 +13,21 @@ struct RootView: View {
1313
}
1414
}
1515
}
16-
16+
1717
var focusView: AnyView? {
1818
if #available(tvOS 14.0, *) {
1919
#if swift(>=5.3)
20-
return AnyView(
21-
NavigationLink(
22-
destination: FocusView(
23-
store: self.store.scope(state: { $0.focus }, action: RootAction.focus)
24-
),
25-
label: {
26-
Text("Focus")
27-
})
28-
)
20+
return AnyView(
21+
NavigationLink(
22+
destination: FocusView(
23+
store: self.store.scope(state: { $0.focus }, action: RootAction.focus)
24+
),
25+
label: {
26+
Text("Focus")
27+
})
28+
)
2929
#else
30-
return nil
30+
return nil
3131
#endif
3232
} else {
3333
return nil

Examples/CaseStudies/tvOSCaseStudiesTests/tvOSCaseStudiesTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import XCTest
2+
23
@testable import tvOSCaseStudies
34

45
class tvOSCaseStudiesTests: XCTestCase {

Examples/VoiceMemos/VoiceMemosTests/VoiceMemosTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ class VoiceMemosTests: XCTestCase {
309309
environment: .mock(
310310
audioPlayerClient: .mock(
311311
play: { id, url in .future { _ in } },
312-
stop: { _ in .fireAndForget { } }
312+
stop: { _ in .fireAndForget {} }
313313
),
314314
mainQueue: self.scheduler
315315
)

Sources/ComposableArchitecture/Internal/Deprecations.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ extension Reducer {
66
self.optional()
77
}
88
}
9-
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#if canImport(CoreMotion)
2-
@_exported import ComposableArchitecture
3-
@_exported import CoreMotion
2+
@_exported import ComposableArchitecture
3+
@_exported import CoreMotion
44
#endif

0 commit comments

Comments
 (0)