Skip to content

Commit d5897bd

Browse files
authored
Expose _ViewControllerKey (#40)
1 parent fcb306f commit d5897bd

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Sources/StorybookKit/Internals/TargetViewControllerKey.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import SwiftUI
22

3-
enum _ViewControllerKey: EnvironmentKey {
4-
static var defaultValue: UIViewController?
3+
public enum _ViewControllerKey: EnvironmentKey {
4+
public static var defaultValue: UIViewController?
55
}
66

77
enum TestKey: EnvironmentKey {

Sources/StorybookKit/StorybookDisplayRootView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ public struct BookActionHosting<Content: View>: View {
2626

2727
private let content: Content
2828

29-
public init(_ content: Content) {
30-
self.content = content
29+
public init(@ViewBuilder content: () -> Content) {
30+
self.content = content()
3131
}
3232

3333
public var body: some View {
@@ -186,7 +186,7 @@ final class _ViewController<Content: View>: UIViewController {
186186
#if DEBUG
187187

188188
#Preview {
189-
BookActionHosting(BookAction(title: "Hello", action: { vc in }))
189+
BookActionHosting { BookAction(title: "Hello", action: { vc in }) }
190190
}
191191

192192
#endif

0 commit comments

Comments
 (0)