Skip to content

Commit 1ad9e7c

Browse files
authored
[chore]: move ViewEnvironment's EnvironmentValues key to the ViewEnvironment module (#266)
1 parent e0e8ace commit 1ad9e7c

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

WorkflowSwiftUIExperimental/Sources/EnvironmentValues+ViewEnvironment.swift renamed to ViewEnvironment/Sources/EnvironmentValues+ViewEnvironment.swift

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,19 @@
1414
* limitations under the License.
1515
*/
1616

17-
import SwiftUI
18-
import WorkflowUI
17+
#if canImport(SwiftUI)
1918

20-
private struct ViewEnvironmentKey: EnvironmentKey {
21-
static let defaultValue: ViewEnvironment = .empty
22-
}
19+
import SwiftUI
2320

24-
public extension EnvironmentValues {
25-
var viewEnvironment: ViewEnvironment {
21+
extension EnvironmentValues {
22+
public var viewEnvironment: ViewEnvironment {
2623
get { self[ViewEnvironmentKey.self] }
2724
set { self[ViewEnvironmentKey.self] = newValue }
2825
}
26+
27+
private struct ViewEnvironmentKey: EnvironmentKey {
28+
static let defaultValue: ViewEnvironment = .empty
29+
}
2930
}
31+
32+
#endif

0 commit comments

Comments
 (0)