File tree Expand file tree Collapse file tree 1 file changed +15
-11
lines changed
Sources/ComposableArchitecture Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Original file line number Diff line number Diff line change 1
1
import Foundation
2
2
import ReactiveSwift
3
- import SwiftUI
3
+ #if canImport(SwiftUI)
4
+ import SwiftUI
5
+ #endif
4
6
import XCTestDynamicOverlay
5
7
6
8
/// The ``Effect`` type encapsulates a unit of work that can be run in the outside world, and can
@@ -316,17 +318,19 @@ public struct Send<Action> {
316
318
self . send ( action)
317
319
}
318
320
319
- /// Sends an action back into the system from an effect with animation.
320
- ///
321
- /// - Parameters:
322
- /// - action: An action.
323
- /// - animation: An animation.
324
- public func callAsFunction( _ action: Action , animation: Animation ? ) {
325
- guard !Task. isCancelled else { return }
326
- withAnimation ( animation) {
327
- self ( action)
321
+ #if canImport(SwiftUI)
322
+ /// Sends an action back into the system from an effect with animation.
323
+ ///
324
+ /// - Parameters:
325
+ /// - action: An action.
326
+ /// - animation: An animation.
327
+ public func callAsFunction( _ action: Action , animation: Animation ? ) {
328
+ guard !Task. isCancelled else { return }
329
+ withAnimation ( animation) {
330
+ self ( action)
331
+ }
328
332
}
329
- }
333
+ #endif
330
334
}
331
335
332
336
// MARK: - Composing Effects
You can’t perform that action at this time.
0 commit comments