Skip to content

Commit

Permalink
Expose _ViewControllerKey (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
muukii committed Apr 16, 2024
1 parent fcb306f commit d5897bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Sources/StorybookKit/Internals/TargetViewControllerKey.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftUI

enum _ViewControllerKey: EnvironmentKey {
static var defaultValue: UIViewController?
public enum _ViewControllerKey: EnvironmentKey {
public static var defaultValue: UIViewController?
}

enum TestKey: EnvironmentKey {
Expand Down
6 changes: 3 additions & 3 deletions Sources/StorybookKit/StorybookDisplayRootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public struct BookActionHosting<Content: View>: View {

private let content: Content

public init(_ content: Content) {
self.content = content
public init(@ViewBuilder content: () -> Content) {
self.content = content()
}

public var body: some View {
Expand Down Expand Up @@ -186,7 +186,7 @@ final class _ViewController<Content: View>: UIViewController {
#if DEBUG

#Preview {
BookActionHosting(BookAction(title: "Hello", action: { vc in }))
BookActionHosting { BookAction(title: "Hello", action: { vc in }) }
}

#endif

0 comments on commit d5897bd

Please sign in to comment.