From c80a216fd0c3028143d4e5afb1a5daa4d0c3e846 Mon Sep 17 00:00:00 2001 From: Muukii Date: Tue, 16 Apr 2024 17:15:57 +0900 Subject: [PATCH] Patch --- .../StorybookKit/Internals/TargetViewControllerKey.swift | 4 ++-- Sources/StorybookKit/StorybookDisplayRootView.swift | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/StorybookKit/Internals/TargetViewControllerKey.swift b/Sources/StorybookKit/Internals/TargetViewControllerKey.swift index af040ce..ddcbf92 100644 --- a/Sources/StorybookKit/Internals/TargetViewControllerKey.swift +++ b/Sources/StorybookKit/Internals/TargetViewControllerKey.swift @@ -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 { diff --git a/Sources/StorybookKit/StorybookDisplayRootView.swift b/Sources/StorybookKit/StorybookDisplayRootView.swift index 8744532..b6bb6b4 100644 --- a/Sources/StorybookKit/StorybookDisplayRootView.swift +++ b/Sources/StorybookKit/StorybookDisplayRootView.swift @@ -26,8 +26,8 @@ public struct BookActionHosting: 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 { @@ -186,7 +186,7 @@ final class _ViewController: UIViewController { #if DEBUG #Preview { - BookActionHosting(BookAction(title: "Hello", action: { vc in })) + BookActionHosting { BookAction(title: "Hello", action: { vc in }) } } #endif