Skip to content

Commit

Permalink
Conditionally import swift ui
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiVidrasco committed Oct 12, 2020
1 parent 7630087 commit 4ca6118
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 0 deletions.
@@ -1,3 +1,4 @@
#if canImport(SwiftUI)
import SwiftUI

@available(iOS 13.0, macOS 10.15, macCatalyst 13, tvOS 13.0, watchOS 6.0, *)
Expand Down Expand Up @@ -29,3 +30,4 @@ extension LocalizedStringKey: CustomDebugOutputConvertible {
self.formatted().debugDescription
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/ComposableArchitecture/SwiftUI/ActionSheet.swift
@@ -1,3 +1,4 @@
#if canImport(SwiftUI)
import SwiftUI

/// A data type that describes the state of an action sheet that can be shown to the user. The
Expand Down Expand Up @@ -221,3 +222,4 @@ extension ActionSheetState {
)
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/ComposableArchitecture/SwiftUI/Alert.swift
@@ -1,3 +1,4 @@
#if canImport(SwiftUI)
import SwiftUI

/// A data type that describes the state of an alert that can be shown to the user. The `Action`
Expand Down Expand Up @@ -298,3 +299,4 @@ extension AlertState {
}
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/ComposableArchitecture/SwiftUI/ForEachStore.swift
@@ -1,3 +1,4 @@
#if canImport(SwiftUI)
import SwiftUI

/// A structure that computes views on demand from a store on a collection of data.
Expand Down Expand Up @@ -119,3 +120,4 @@ where Data: Collection, ID: Hashable, Content: View {
self.content()
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/ComposableArchitecture/SwiftUI/IfLetStore.swift
@@ -1,3 +1,4 @@
#if canImport(SwiftUI)
import SwiftUI

/// A view that safely unwraps a store of optional state in order to show one of two views.
Expand Down Expand Up @@ -83,3 +84,4 @@ public struct IfLetStore<State, Action, Content>: View where Content: View {
)
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/ComposableArchitecture/SwiftUI/WithViewStore.swift
@@ -1,3 +1,4 @@
#if canImport(Combine) && canImport(SwiftUI)
import Combine
import SwiftUI

Expand Down Expand Up @@ -105,3 +106,4 @@ extension WithViewStore: DynamicViewContent where State: Collection, Content: Dy
self.viewStore.state
}
}
#endif

0 comments on commit 4ca6118

Please sign in to comment.