Skip to content

Commit 4ec160b

Browse files
authored
[NFC] Remove OPENSWIFTUI_SUPPRESS_DEPRECATED_WARNINGS flag (#415)
1 parent fb017de commit 4ec160b

File tree

2 files changed

+0
-61
lines changed

2 files changed

+0
-61
lines changed

Package.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ var sharedSwiftSettings: [SwiftSetting] = [
5959
.enableUpcomingFeature("InternalImportsByDefault"),
6060
.enableUpcomingFeature("InferSendableFromCaptures"),
6161
.unsafeFlags(["-Wwarning", "DeprecatedDeclaration"]), // We want to use deprecated APIs in test targets
62-
.define("OPENSWIFTUI_SUPPRESS_DEPRECATED_WARNINGS"),
6362
// FIXME: -unavailable-decl-optimization=stub is not working somehow (eg. Color.vibrancy). Dig into this later
6463
.unsafeFlags(["-unavailable-decl-optimization=stub"]),
6564
.swiftLanguageMode(.v5),

Sources/OpenSwiftUI/View/Control/Slider/Slider.swift

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,7 @@ extension Slider {
130130
/// The slider calls `onEditingChanged` when editing begins and ends. For
131131
/// example, on iOS, editing begins when the user starts to drag the thumb
132132
/// along the slider's track.
133-
#if !OPENSWIFTUI_SUPPRESS_DEPRECATED_WARNINGS
134133
@_alwaysEmitIntoClient
135-
#endif
136134
public init<V>(
137135
value: Binding<V>,
138136
in bounds: ClosedRange<V> = 0 ... 1,
@@ -141,18 +139,6 @@ extension Slider {
141139
@ViewBuilder maximumValueLabel: () -> ValueLabel,
142140
onEditingChanged: @escaping (Bool) -> Void = { _ in }
143141
) where V: BinaryFloatingPoint, V.Stride: BinaryFloatingPoint {
144-
#if OPENSWIFTUI_SUPPRESS_DEPRECATED_WARNINGS
145-
self.init(
146-
value: value,
147-
in: bounds,
148-
step: nil,
149-
onEditingChanged: onEditingChanged,
150-
minimumValueLabel: minimumValueLabel(),
151-
maximumValueLabel: maximumValueLabel(),
152-
customMinMaxValueLabels: true,
153-
label: label()
154-
)
155-
#else
156142
self.init(
157143
value: value,
158144
in: bounds,
@@ -161,7 +147,6 @@ extension Slider {
161147
maximumValueLabel: maximumValueLabel(),
162148
label: label
163149
)
164-
#endif
165150
}
166151

167152
/// Creates a slider to select a value from a given range, subject to a
@@ -185,9 +170,7 @@ extension Slider {
185170
/// The slider calls `onEditingChanged` when editing begins and ends. For
186171
/// example, on iOS, editing begins when the user starts to drag the thumb
187172
/// along the slider's track.
188-
#if !OPENSWIFTUI_SUPPRESS_DEPRECATED_WARNINGS
189173
@_alwaysEmitIntoClient
190-
#endif
191174
public init<V>(
192175
value: Binding<V>,
193176
in bounds: ClosedRange<V>,
@@ -197,18 +180,6 @@ extension Slider {
197180
@ViewBuilder maximumValueLabel: () -> ValueLabel,
198181
onEditingChanged: @escaping (Bool) -> Void = { _ in }
199182
) where V: BinaryFloatingPoint, V.Stride: BinaryFloatingPoint {
200-
#if OPENSWIFTUI_SUPPRESS_DEPRECATED_WARNINGS
201-
self.init(
202-
value: value,
203-
in: bounds,
204-
step: step,
205-
onEditingChanged: onEditingChanged,
206-
minimumValueLabel: minimumValueLabel(),
207-
maximumValueLabel: maximumValueLabel(),
208-
customMinMaxValueLabels: true,
209-
label: label()
210-
)
211-
#else
212183
self.init(
213184
value: value,
214185
in: bounds,
@@ -218,7 +189,6 @@ extension Slider {
218189
maximumValueLabel: maximumValueLabel(),
219190
label: label
220191
)
221-
#endif
222192
}
223193
}
224194

@@ -242,34 +212,19 @@ extension Slider where ValueLabel == EmptyView {
242212
/// The slider calls `onEditingChanged` when editing begins and ends. For
243213
/// example, on iOS, editing begins when the user starts to drag the thumb
244214
/// along the slider's track.
245-
#if !OPENSWIFTUI_SUPPRESS_DEPRECATED_WARNINGS
246215
@_alwaysEmitIntoClient
247-
#endif
248216
public init<V>(
249217
value: Binding<V>,
250218
in bounds: ClosedRange<V> = 0 ... 1,
251219
@ViewBuilder label: () -> Label,
252220
onEditingChanged: @escaping (Bool) -> Void = { _ in }
253221
) where V: BinaryFloatingPoint, V.Stride: BinaryFloatingPoint {
254-
#if OPENSWIFTUI_SUPPRESS_DEPRECATED_WARNINGS
255-
self.init(
256-
value: value,
257-
in: bounds,
258-
step: nil,
259-
onEditingChanged: onEditingChanged,
260-
minimumValueLabel: EmptyView(),
261-
maximumValueLabel: EmptyView(),
262-
customMinMaxValueLabels: false,
263-
label: label()
264-
)
265-
#else
266222
self.init(
267223
value: value,
268224
in: bounds,
269225
onEditingChanged: onEditingChanged,
270226
label: label
271227
)
272-
#endif
273228
}
274229

275230
/// Creates a slider to select a value from a given range, subject to a
@@ -291,36 +246,21 @@ extension Slider where ValueLabel == EmptyView {
291246
/// The slider calls `onEditingChanged` when editing begins and ends. For
292247
/// example, on iOS, editing begins when the user starts to drag the thumb
293248
/// along the slider's track.
294-
#if !OPENSWIFTUI_SUPPRESS_DEPRECATED_WARNINGS
295249
@_alwaysEmitIntoClient
296-
#endif
297250
public init<V>(
298251
value: Binding<V>,
299252
in bounds: ClosedRange<V>,
300253
step: V.Stride = 1,
301254
@ViewBuilder label: () -> Label,
302255
onEditingChanged: @escaping (Bool) -> Void = { _ in }
303256
) where V: BinaryFloatingPoint, V.Stride: BinaryFloatingPoint {
304-
#if OPENSWIFTUI_SUPPRESS_DEPRECATED_WARNINGS
305-
self.init(
306-
value: value,
307-
in: bounds,
308-
step: step,
309-
onEditingChanged: onEditingChanged,
310-
minimumValueLabel: EmptyView(),
311-
maximumValueLabel: EmptyView(),
312-
customMinMaxValueLabels: false,
313-
label: label()
314-
)
315-
#else
316257
self.init(
317258
value: value,
318259
in: bounds,
319260
step: step,
320261
onEditingChanged: onEditingChanged,
321262
label: label
322263
)
323-
#endif
324264
}
325265
}
326266

0 commit comments

Comments
 (0)