Skip to content

Commit 43654f4

Browse files
mluisbrownactions-user
authored andcommitted
Run swift-format
1 parent 560d7e7 commit 43654f4

File tree

6 files changed

+635
-633
lines changed

6 files changed

+635
-633
lines changed

Sources/ComposableArchitecture/Internal/Deprecations.swift

Lines changed: 80 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,102 @@
11
#if canImport(SwiftUI)
22

3-
import SwiftUI
3+
import SwiftUI
44

5-
// NB: Deprecated after 0.17.0:
5+
// NB: Deprecated after 0.17.0:
66

77
@available(iOS 13, macOS 10.15, macCatalyst 13, tvOS 13, watchOS 6, *)
8-
extension IfLetStore {
9-
@available(*, deprecated, message: "'else' now takes a view builder closure")
10-
public init<IfContent, ElseContent>(
11-
_ store: Store<State?, Action>,
12-
@ViewBuilder then ifContent: @escaping (Store<State, Action>) -> IfContent,
13-
else elseContent: @escaping @autoclosure () -> ElseContent
14-
) where Content == _ConditionalContent<IfContent, ElseContent> {
15-
self.init(store, then: ifContent, else: elseContent)
8+
extension IfLetStore {
9+
@available(*, deprecated, message: "'else' now takes a view builder closure")
10+
public init<IfContent, ElseContent>(
11+
_ store: Store<State?, Action>,
12+
@ViewBuilder then ifContent: @escaping (Store<State, Action>) -> IfContent,
13+
else elseContent: @escaping @autoclosure () -> ElseContent
14+
) where Content == _ConditionalContent<IfContent, ElseContent> {
15+
self.init(store, then: ifContent, else: elseContent)
16+
}
1617
}
17-
}
1818

19-
// NB: Deprecated after 0.10.0:
19+
// NB: Deprecated after 0.10.0:
2020

2121
@available(iOS 13, macOS 10.15, macCatalyst 13, tvOS 13, watchOS 6, *)
22-
extension ActionSheetState {
23-
@available(*, deprecated, message: "'title' and 'message' should be 'TextState'")
24-
@_disfavoredOverload
25-
public init(
26-
title: LocalizedStringKey,
27-
message: LocalizedStringKey? = nil,
28-
buttons: [Button]
29-
) {
30-
self.init(
31-
title: .init(title),
32-
message: message.map { .init($0) },
33-
buttons: buttons
34-
)
22+
extension ActionSheetState {
23+
@available(*, deprecated, message: "'title' and 'message' should be 'TextState'")
24+
@_disfavoredOverload
25+
public init(
26+
title: LocalizedStringKey,
27+
message: LocalizedStringKey? = nil,
28+
buttons: [Button]
29+
) {
30+
self.init(
31+
title: .init(title),
32+
message: message.map { .init($0) },
33+
buttons: buttons
34+
)
35+
}
3536
}
36-
}
3737

3838
@available(iOS 13, macOS 10.15, macCatalyst 13, tvOS 13, watchOS 6, *)
39-
extension AlertState {
40-
@available(*, deprecated, message: "'title' and 'message' should be 'TextState'")
41-
@_disfavoredOverload
42-
public init(
43-
title: LocalizedStringKey,
44-
message: LocalizedStringKey? = nil,
45-
dismissButton: Button? = nil
46-
) {
47-
self.init(
48-
title: .init(title),
49-
message: message.map { .init($0) },
50-
dismissButton: dismissButton
51-
)
52-
}
39+
extension AlertState {
40+
@available(*, deprecated, message: "'title' and 'message' should be 'TextState'")
41+
@_disfavoredOverload
42+
public init(
43+
title: LocalizedStringKey,
44+
message: LocalizedStringKey? = nil,
45+
dismissButton: Button? = nil
46+
) {
47+
self.init(
48+
title: .init(title),
49+
message: message.map { .init($0) },
50+
dismissButton: dismissButton
51+
)
52+
}
5353

54-
@available(*, deprecated, message: "'title' and 'message' should be 'TextState'")
55-
@_disfavoredOverload
56-
public init(
57-
title: LocalizedStringKey,
58-
message: LocalizedStringKey? = nil,
59-
primaryButton: Button,
60-
secondaryButton: Button
61-
) {
62-
self.init(
63-
title: .init(title),
64-
message: message.map { .init($0) },
65-
primaryButton: primaryButton,
66-
secondaryButton: secondaryButton
67-
)
54+
@available(*, deprecated, message: "'title' and 'message' should be 'TextState'")
55+
@_disfavoredOverload
56+
public init(
57+
title: LocalizedStringKey,
58+
message: LocalizedStringKey? = nil,
59+
primaryButton: Button,
60+
secondaryButton: Button
61+
) {
62+
self.init(
63+
title: .init(title),
64+
message: message.map { .init($0) },
65+
primaryButton: primaryButton,
66+
secondaryButton: secondaryButton
67+
)
68+
}
6869
}
69-
}
7070

7171
@available(iOS 13, macOS 10.15, macCatalyst 13, tvOS 13, watchOS 6, *)
72-
extension AlertState.Button {
73-
@available(*, deprecated, message: "'label' should be 'TextState'")
74-
@_disfavoredOverload
75-
public static func cancel(
76-
_ label: LocalizedStringKey,
77-
send action: Action? = nil
78-
) -> Self {
79-
Self(action: action, type: .cancel(label: .init(label)))
80-
}
72+
extension AlertState.Button {
73+
@available(*, deprecated, message: "'label' should be 'TextState'")
74+
@_disfavoredOverload
75+
public static func cancel(
76+
_ label: LocalizedStringKey,
77+
send action: Action? = nil
78+
) -> Self {
79+
Self(action: action, type: .cancel(label: .init(label)))
80+
}
8181

82-
@available(*, deprecated, message: "'label' should be 'TextState'")
83-
@_disfavoredOverload
84-
public static func `default`(
85-
_ label: LocalizedStringKey,
86-
send action: Action? = nil
87-
) -> Self {
88-
Self(action: action, type: .default(label: .init(label)))
89-
}
82+
@available(*, deprecated, message: "'label' should be 'TextState'")
83+
@_disfavoredOverload
84+
public static func `default`(
85+
_ label: LocalizedStringKey,
86+
send action: Action? = nil
87+
) -> Self {
88+
Self(action: action, type: .default(label: .init(label)))
89+
}
9090

91-
@available(*, deprecated, message: "'label' should be 'TextState'")
92-
@_disfavoredOverload
93-
public static func destructive(
94-
_ label: LocalizedStringKey,
95-
send action: Action? = nil
96-
) -> Self {
97-
Self(action: action, type: .destructive(label: .init(label)))
91+
@available(*, deprecated, message: "'label' should be 'TextState'")
92+
@_disfavoredOverload
93+
public static func destructive(
94+
_ label: LocalizedStringKey,
95+
send action: Action? = nil
96+
) -> Self {
97+
Self(action: action, type: .destructive(label: .init(label)))
98+
}
9899
}
99-
}
100100
#endif
101101

102102
// NB: Deprecated after 0.9.0:

0 commit comments

Comments
 (0)