Skip to content

Commit d3768d6

Browse files
mluisbrowngithub-actions[bot]
authored andcommitted
Run swift-format
1 parent 10850a3 commit d3768d6

32 files changed

+3596
-3587
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ let sharedStateCounterReducer = Reducer<
108108
state.alert = AlertState(
109109
title: TextState(
110110
isPrime(state.count)
111-
? "👍 The number \(state.count) is prime!"
112-
: "👎 The number \(state.count) is not prime :("
111+
? "👍 The number \(state.count) is prime!"
112+
: "👎 The number \(state.count) is not prime :("
113113
)
114114
)
115115
return .none

Examples/CaseStudies/SwiftUICaseStudies/02-Effects-LongLiving.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ let longLivingEffectsReducer = Reducer<
5151
.map { _ in LongLivingEffectsAction.userDidTakeScreenshotNotification }
5252
.cancellable(id: UserDidTakeScreenshotNotificationId.self)
5353

54-
5554
case .onDisappear:
5655
// When view disappears, stop the effect.
5756
return .cancel(id: UserDidTakeScreenshotNotificationId.self)

Examples/CaseStudies/SwiftUICaseStudies/02-Effects-WebSocket.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,12 @@ let webSocketReducer = Reducer<WebSocketState, WebSocketAction, WebSocketEnviron
7070

7171
case .disconnected:
7272
state.connectivityState = .connecting
73-
return environment.webSocket.open(WebSocketId(), URL(string: "wss://echo.websocket.events")!, [])
74-
.observe(on: environment.mainQueue)
75-
.map(WebSocketAction.webSocket)
76-
.cancellable(id: WebSocketId())
73+
return environment.webSocket.open(
74+
WebSocketId(), URL(string: "wss://echo.websocket.events")!, []
75+
)
76+
.observe(on: environment.mainQueue)
77+
.map(WebSocketAction.webSocket)
78+
.cancellable(id: WebSocketId())
7779
}
7880

7981
case let .messageToSendChanged(message):

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ let clockReducer = Reducer<ClockState, ClockAction, ClockEnvironment>.combine(
7979

8080
struct ClockView: View {
8181
let store: Store<ClockState, ClockAction>
82-
82+
8383
var body: some View {
8484
WithViewStore(store) { viewStore in
8585
VStack {
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
#if canImport(SwiftUI)
2-
import SwiftUI
2+
import SwiftUI
33

4-
extension Binding {
5-
/// SwiftUI will print errors to the console about "AttributeGraph: cycle detected" if you disable
6-
/// a text field while it is focused. This hack will force all fields to unfocus before we write
7-
/// to a binding that may disable the fields.
8-
///
9-
/// See also: https://stackoverflow.com/a/69653555
10-
func resignFirstResponder() -> Self {
11-
Self(
12-
get: { self.wrappedValue },
13-
set: { newValue, transaction in
14-
UIApplication.shared.sendAction(
15-
#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil
16-
)
17-
self.transaction(transaction).wrappedValue = newValue
18-
}
19-
)
4+
extension Binding {
5+
/// SwiftUI will print errors to the console about "AttributeGraph: cycle detected" if you disable
6+
/// a text field while it is focused. This hack will force all fields to unfocus before we write
7+
/// to a binding that may disable the fields.
8+
///
9+
/// See also: https://stackoverflow.com/a/69653555
10+
func resignFirstResponder() -> Self {
11+
Self(
12+
get: { self.wrappedValue },
13+
set: { newValue, transaction in
14+
UIApplication.shared.sendAction(
15+
#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil
16+
)
17+
self.transaction(transaction).wrappedValue = newValue
18+
}
19+
)
20+
}
2021
}
21-
}
2222
#endif

Examples/Search/SearchTests/SearchTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class SearchTests: XCTestCase {
125125
temperatureMaxUnit: "°F",
126126
temperatureMin: 80,
127127
temperatureMinUnit: "°F"
128-
)
128+
),
129129
]
130130
)
131131
}
@@ -187,7 +187,7 @@ class SearchTests: XCTestCase {
187187
temperatureMaxUnit: "°F",
188188
temperatureMin: 80,
189189
temperatureMinUnit: "°F"
190-
)
190+
),
191191
]
192192
)
193193
}

Examples/TicTacToe/tic-tac-toe/Sources/AuthenticationClientLive/LiveAuthenticationClient.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ extension AuthenticationClient {
1717
return Effect(error: .invalidUserPassword)
1818
}
1919
}
20-
return effect
20+
return
21+
effect
2122
.delay(1, on: QueueScheduler(qos: .default, name: "auth", targeting: queue))
2223
},
2324
twoFactor: { request in
@@ -32,7 +33,8 @@ extension AuthenticationClient {
3233
)
3334
}
3435
}
35-
return effect
36+
return
37+
effect
3638
.delay(1, on: QueueScheduler(qos: .default, name: "auth", targeting: queue))
3739
}
3840
)

Examples/TicTacToe/tic-tac-toe/Sources/LoginSwiftUI/LoginView.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ public struct LoginView: View {
4545
WithViewStore(self.store.scope(state: ViewState.init, action: LoginAction.init)) { viewStore in
4646
Form {
4747
Text(
48-
"""
49-
To login use any email and "password" for the password. If your email contains the \
50-
characters "2fa" you will be taken to a two-factor flow, and on that screen you can \
51-
use "1234" for the code.
52-
"""
48+
"""
49+
To login use any email and "password" for the password. If your email contains the \
50+
characters "2fa" you will be taken to a two-factor flow, and on that screen you can \
51+
use "1234" for the code.
52+
"""
5353
)
5454

5555
Section {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import AppCore
22
import AuthenticationClient
33
import ComposableArchitecture
4-
import ReactiveSwift
54
import LoginCore
65
import NewGameCore
6+
import ReactiveSwift
77
import TwoFactorCore
88
import XCTest
99

Examples/VoiceMemos/VoiceMemos/VoiceMemo.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ struct VoiceMemoView: View {
101101

102102
var body: some View {
103103
WithViewStore(store) { viewStore in
104-
let currentTime = viewStore.mode.progress.map { $0 * viewStore.duration } ?? viewStore.duration
104+
let currentTime =
105+
viewStore.mode.progress.map { $0 * viewStore.duration } ?? viewStore.duration
105106
HStack {
106107
TextField(
107108
"Untitled, \(viewStore.date.formatted(date: .numeric, time: .shortened))",

0 commit comments

Comments
 (0)