Skip to content

Commit 7af22c6

Browse files
Refactor: Remove #if compiler directives
Removed #if compiler(>=X.X) directives by keeping the code within the #if block and removing the #else and #endif blocks. This assumes the codebase is compiled with a modern Swift compiler where these conditional blocks are no longer necessary.
1 parent 9146fb9 commit 7af22c6

File tree

4 files changed

+0
-21
lines changed

4 files changed

+0
-21
lines changed

abtesting/Shared/AppConfig.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ class AppConfig: ObservableObject {
5555
}
5656
}
5757

58-
#if compiler(>=5.5) && canImport(_Concurrency)
5958
func updateFromRemoteConfigAsync() async {
6059
let remoteConfig = RemoteConfig.remoteConfig()
6160
let oldValue = remoteConfig["color_scheme"].stringValue ?? "nil"

abtesting/Shared/ContentView.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,11 @@ struct FirebaseList: View {
3939
]
4040
var body: some View {
4141
VStack {
42-
#if compiler(>=5.5) && canImport(_Concurrency)
4342
BasicList(data: data)
4443
.preferredColorScheme(appConfig.colorScheme)
4544
.foregroundColor(appConfig.colorScheme == .dark ? .orange : .primary)
4645
.task { await appConfig.updateFromRemoteConfigAsync() }
4746
.refreshable { await appConfig.updateFromRemoteConfigAsync() }
48-
#else
49-
BasicList(data: data)
50-
.preferredColorScheme(appConfig.colorScheme)
51-
.foregroundColor(appConfig.colorScheme == .dark ? .orange : .primary)
52-
.onAppear { appConfig.updateFromRemoteConfig() }
53-
#endif
5447
Button("Refresh") { appConfig.updateFromRemoteConfig() }
5548
Spacer()
5649
}

crashlytics/Shared/ContentView.swift

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,12 @@ struct CrashButtonView: View {
3333
struct ContentView: View {
3434
private var crashlyticsReference = Crashlytics.crashlytics()
3535

36-
#if compiler(>=5.5) && canImport(_Concurrency)
3736
func checkForUnsentReportsAsync() async {
3837
let reportFound = await crashlyticsReference.checkForUnsentReports()
3938
if reportFound {
4039
crashlyticsReference.sendUnsentReports()
4140
}
4241
}
43-
#endif
4442

4543
func checkForUnsentReports() {
4644
crashlyticsReference.checkForUnsentReports { reportFound in
@@ -51,17 +49,10 @@ struct ContentView: View {
5149
}
5250

5351
var body: some View {
54-
#if compiler(>=5.5) && canImport(_Concurrency)
5552
CrashButtonView()
5653
.task {
5754
await self.checkForUnsentReportsAsync()
5855
}
59-
#else
60-
CrashButtonView()
61-
.onAppear {
62-
self.checkForUnsentReports()
63-
}
64-
#endif
6556
}
6657
}
6758

database/DatabaseExampleSwiftUI/DatabaseExample/Shared/Views/PostCell.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,9 @@ struct PostCell: View {
3131
#if os(iOS) || os(macOS)
3232
starButton
3333
.onTapGesture {
34-
#if compiler(>=5.5) && canImport(_Concurrency)
3534
Task { await
3635
post.didTapStarButtonAsync()
3736
}
38-
#else
39-
post.didTapStarButton()
40-
#endif
4137
}
4238
#elseif os(tvOS)
4339
starButton

0 commit comments

Comments
 (0)