Skip to content

Commit dbaf423

Browse files
mluisbrownactions-user
authored andcommitted
Run swift-format
1 parent b1350e6 commit dbaf423

File tree

26 files changed

+2693
-2686
lines changed

26 files changed

+2693
-2686
lines changed

Examples/CaseStudies/SwiftUICaseStudies/00-RootView.swift

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ struct RootView: View {
8282
)
8383

8484
#if compiler(>=5.5)
85-
NavigationLink(
86-
"Focus State",
87-
destination: FocusDemoView(
88-
store: self.store.scope(
89-
state: \.focusDemo,
90-
action: RootAction.focusDemo
85+
NavigationLink(
86+
"Focus State",
87+
destination: FocusDemoView(
88+
store: self.store.scope(
89+
state: \.focusDemo,
90+
action: RootAction.focusDemo
91+
)
9192
)
9293
)
93-
)
9494
#endif
9595

9696
NavigationLink(
@@ -135,15 +135,15 @@ struct RootView: View {
135135
)
136136

137137
#if compiler(>=5.5)
138-
NavigationLink(
139-
"Refreshable",
140-
destination: RefreshableView(
141-
store: self.store.scope(
142-
state: \.refreshable,
143-
action: RootAction.refreshable
138+
NavigationLink(
139+
"Refreshable",
140+
destination: RefreshableView(
141+
store: self.store.scope(
142+
state: \.refreshable,
143+
action: RootAction.refreshable
144+
)
144145
)
145146
)
146-
)
147147
#endif
148148

149149
NavigationLink(

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ let animationsReducer = Reducer<AnimationsState, AnimationsAction, AnimationsEnv
6565
case let .circleScaleToggleChanged(isScaled):
6666
state.isCircleScaled = isScaled
6767
return .none
68-
68+
6969
case .dismissAlert:
7070
state.alert = nil
7171
return .none
@@ -76,7 +76,7 @@ let animationsReducer = Reducer<AnimationsState, AnimationsAction, AnimationsEnv
7676
.map { (output: .setColor($0), duration: 1) },
7777
scheduler: environment.mainQueue.animation(.linear)
7878
)
79-
79+
8080
case .resetButtonTapped:
8181
state.alert = .init(
8282
title: .init("Reset state?"),
@@ -87,7 +87,7 @@ let animationsReducer = Reducer<AnimationsState, AnimationsAction, AnimationsEnv
8787
secondaryButton: .cancel()
8888
)
8989
return .none
90-
90+
9191
case .resetConfirmationButtonTapped:
9292
state = .init()
9393
return .none

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ let focusDemoReducer = Reducer<
5555

5656
VStack {
5757
TextField("Username", text: viewStore.$username)
58-
.focused($focusedField, equals: .username)
58+
.focused($focusedField, equals: .username)
5959

6060
SecureField("Password", text: viewStore.$password)
61-
.focused($focusedField, equals: .password)
61+
.focused($focusedField, equals: .password)
6262

6363
Button("Sign In") {
6464
viewStore.send(.signInButtonTapped)

Examples/CaseStudies/SwiftUICaseStudies/FactClient.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ struct FactClient {
99
struct Error: Swift.Error, Equatable {}
1010
}
1111

12-
// This is the "live" fact dependency that reaches into the outside world to fetch trivia.
13-
// Typically this live implementation of the dependency would live in its own module so that the
14-
// main feature doesn't need to compile it.
12+
// This is the "live" fact dependency that reaches into the outside world to fetch trivia.
13+
// Typically this live implementation of the dependency would live in its own module so that the
14+
// main feature doesn't need to compile it.
1515
extension FactClient {
1616
#if compiler(>=5.5)
17-
static let live = Self(
18-
fetch: { number in
17+
static let live = Self(
18+
fetch: { number in
1919
Effect.task {
2020
do {
2121
let (data, _) = try await URLSession.shared

Examples/CaseStudies/SwiftUICaseStudiesTests/02-Effects-RefreshableTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import ReactiveSwift
21
import ComposableArchitecture
2+
import ReactiveSwift
33
import XCTest
44

55
@testable import SwiftUICaseStudies

Examples/SpeechRecognition/SpeechRecognition/SpeechRecognition.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ let appReducer = Reducer<AppState, AppAction, AppEnvironment> { state, action, e
104104
}
105105
}
106106
}
107-
.debug(actionFormat: .labelsOnly)
107+
.debug(actionFormat: .labelsOnly)
108108

109109
struct AuthorizationStateAlert: Equatable, Identifiable {
110110
var title: String

Examples/TicTacToe/tic-tac-toe/Package.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import PackageDescription
55
let package = Package(
66
name: "tic-tac-toe",
77
platforms: [
8-
.iOS(.v14),
8+
.iOS(.v14)
99
],
1010
products: [
1111
.library(name: "AppCore", targets: ["AppCore"]),
@@ -27,7 +27,7 @@ let package = Package(
2727
.library(name: "TwoFactorUIKit", targets: ["TwoFactorUIKit"]),
2828
],
2929
dependencies: [
30-
.package(name: "reactiveswift-composable-architecture", path: "../../.."),
30+
.package(name: "reactiveswift-composable-architecture", path: "../../..")
3131
],
3232
targets: [
3333
.target(
@@ -63,7 +63,7 @@ let package = Package(
6363
.target(
6464
name: "AuthenticationClient",
6565
dependencies: [
66-
.product(name: "ComposableArchitecture", package: "reactiveswift-composable-architecture"),
66+
.product(name: "ComposableArchitecture", package: "reactiveswift-composable-architecture")
6767
]
6868
),
6969
.target(
@@ -74,7 +74,7 @@ let package = Package(
7474
.target(
7575
name: "GameCore",
7676
dependencies: [
77-
.product(name: "ComposableArchitecture", package: "reactiveswift-composable-architecture"),
77+
.product(name: "ComposableArchitecture", package: "reactiveswift-composable-architecture")
7878
]
7979
),
8080
.testTarget(

Examples/TicTacToe/tic-tac-toe/Tests/AppCoreTests/AppCoreTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import ComposableArchitecture
2-
import ReactiveSwift
31
import AppCore
42
import AuthenticationClient
3+
import ComposableArchitecture
4+
import ReactiveSwift
55
import XCTest
66

77
class AppCoreTests: XCTestCase {

Examples/VoiceMemos/VoiceMemos/VoiceMemos.swift

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -224,17 +224,16 @@ struct VoiceMemosView: View {
224224
}
225225
}
226226

227-
if
228-
let duration = viewStore.currentRecording?.duration,
227+
if let duration = viewStore.currentRecording?.duration,
229228
let formattedDuration = dateComponentsFormatter.string(from: duration)
230229
{
231230
Text(formattedDuration)
232-
.font(Font.body.monospacedDigit().bold())
233-
.foregroundColor(.white)
234-
.colorMultiply(Color(Int(duration).isMultiple(of: 2) ? .systemRed : .label))
235-
.animation(.easeInOut(duration: 0.5))
236-
}
231+
.font(Font.body.monospacedDigit().bold())
232+
.foregroundColor(.white)
233+
.colorMultiply(Color(Int(duration).isMultiple(of: 2) ? .systemRed : .label))
234+
.animation(.easeInOut(duration: 0.5))
237235
}
236+
}
238237
.padding()
239238
}
240239
.alert(

Sources/ComposableArchitecture/Beta/Concurrency.swift

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import ReactiveSwift
2+
23
#if canImport(SwiftUI)
3-
import SwiftUI
4+
import SwiftUI
45
#endif
56

67
#if compiler(>=5.5)
@@ -199,23 +200,23 @@ import SwiftUI
199200
}
200201

201202
#if canImport(SwiftUI)
202-
/// Sends an action into the store and then suspends while a piece of state is `true`.
203-
///
204-
/// See the documentation of ``send(_:while:)`` for more information.
205-
///
206-
/// - Parameters:
207-
/// - action: An action.
208-
/// - animation: The animation to perform when the action is sent.
209-
/// - predicate: A predicate on `State` that determines for how long this method should
210-
/// suspend.
211-
public func send(
212-
_ action: Action,
213-
animation: Animation?,
214-
while predicate: @escaping (State) -> Bool
215-
) async {
216-
withAnimation(animation) { self.send(action) }
217-
await self.suspend(while: predicate)
218-
}
203+
/// Sends an action into the store and then suspends while a piece of state is `true`.
204+
///
205+
/// See the documentation of ``send(_:while:)`` for more information.
206+
///
207+
/// - Parameters:
208+
/// - action: An action.
209+
/// - animation: The animation to perform when the action is sent.
210+
/// - predicate: A predicate on `State` that determines for how long this method should
211+
/// suspend.
212+
public func send(
213+
_ action: Action,
214+
animation: Animation?,
215+
while predicate: @escaping (State) -> Bool
216+
) async {
217+
withAnimation(animation) { self.send(action) }
218+
await self.suspend(while: predicate)
219+
}
219220
#endif
220221

221222
/// Suspends while a predicate on state is `true`.
@@ -228,15 +229,16 @@ import SwiftUI
228229
handler: { cancellable.wrappedValue?.dispose() },
229230
operation: {
230231
try Task.checkCancellation()
231-
try await withUnsafeThrowingContinuation { (continuation: UnsafeContinuation<Void, Error>) in
232+
try await withUnsafeThrowingContinuation {
233+
(continuation: UnsafeContinuation<Void, Error>) in
232234
guard !Task.isCancelled else {
233235
continuation.resume(throwing: CancellationError())
234236
return
235237
}
236238
cancellable.wrappedValue = self.produced.producer
237239
.filter { !predicate($0) }
238-
.take(first: 1)
239-
.startWithValues { _ in
240+
.take(first: 1)
241+
.startWithValues { _ in
240242
continuation.resume()
241243
_ = cancellable
242244
}

0 commit comments

Comments
 (0)