Skip to content

Commit b6beb6b

Browse files
committed
Conditional import for building with earlier SDKs.
1 parent 0e845ad commit b6beb6b

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

Loop/Public/SwiftUI/EnvironmentLoop.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#if canImport(SwiftUI) && canImport(Combine)
2+
13
import SwiftUI
24
import Combine
35
import ReactiveSwift
@@ -47,3 +49,5 @@ public struct EnvironmentLoop<State, Event>: DynamicProperty {
4749
acknowledgedState = subscription.latestValue
4850
}
4951
}
52+
53+
#endif

Loop/Public/SwiftUI/EnvironmentValues.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#if canImport(SwiftUI)
2+
13
import SwiftUI
24

35
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
@@ -26,3 +28,5 @@ internal enum LoopEnvironmentKey: EnvironmentKey {
2628
return [:]
2729
}
2830
}
31+
32+
#endif

Loop/Public/SwiftUI/LoopBinding.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#if canImport(SwiftUI) && canImport(Combine)
2+
13
import SwiftUI
24
import Combine
35
import ReactiveSwift
@@ -47,3 +49,5 @@ public struct LoopBinding<State, Event>: DynamicProperty {
4749
loop.send(event)
4850
}
4951
}
52+
53+
#endif

Loop/Public/SwiftUI/SwiftUISubscription.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import SwiftUI
2+
#if canImport(Combine)
3+
24
import Combine
35
import ReactiveSwift
46

@@ -30,3 +32,5 @@ internal final class SwiftUISubscription<State, Event>: ObservableObject {
3032
}
3133
}
3234
}
35+
36+
#endif

0 commit comments

Comments
 (0)