Skip to content

Commit 3637f31

Browse files
authored
fix: Add #if swift check for Combine publishers (#775)
Prevents errors for customers compiling with Swift toolchains < 5.2 refs: - #717 - #740 - #744
1 parent 2c76122 commit 3637f31

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

Amplify/Categories/API/Operation/AmplifyOperation+APIPublishers.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ import Foundation
1010

1111
// MARK: - GraphQLOperation
1212

13+
// The overrides require a feature and bugfix introduced in Swift 5.2
14+
#if swift(>=5.2)
15+
1316
@available(iOS 13.0, *)
1417
public extension GraphQLOperation {
1518
/// Publishes the final result of the operation
@@ -104,3 +107,5 @@ public extension AmplifyOperation
104107
internalResultPublisher
105108
}
106109
}
110+
111+
#endif

Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ import Foundation
1010

1111
// MARK: - AuthAttributeResendConfirmationCodeOperation
1212

13+
// The overrides require a feature and bugfix introduced in Swift 5.2
14+
#if swift(>=5.2)
15+
1316
@available(iOS 13.0, *)
1417
public extension AmplifyOperation
1518
where
@@ -273,3 +276,5 @@ public extension AmplifyOperation
273276
internalResultPublisher
274277
}
275278
}
279+
280+
#endif

Amplify/Categories/Predictions/Operation/AmplifyOperation+PredictionsPublishers.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ import Foundation
1010

1111
// MARK: - PredictionsIdentifyOperation
1212

13+
// The overrides require a feature and bugfix introduced in Swift 5.2
14+
#if swift(>=5.2)
15+
1316
@available(iOS 13.0, *)
1417
public extension AmplifyOperation
1518
where
@@ -77,3 +80,5 @@ public extension AmplifyOperation
7780
internalResultPublisher
7881
}
7982
}
83+
84+
#endif

Amplify/Categories/Storage/Operation/Operation+StoragePublishers.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ import Foundation
1010

1111
// MARK: - StorageDownloadDataOperation
1212

13+
// The overrides require a feature and bugfix introduced in Swift 5.2
14+
#if swift(>=5.2)
15+
1316
@available(iOS 13.0, *)
1417
public extension AmplifyInProcessReportingOperation
1518
where
@@ -145,3 +148,5 @@ public extension AmplifyInProcessReportingOperation
145148
internalInProcessPublisher
146149
}
147150
}
151+
152+
#endif

0 commit comments

Comments
 (0)