Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make public #47

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import SwiftUI

extension EnvironmentValues {
@Entry var _targetViewController: UIViewController?
@Entry public var storybook_targetViewController: UIViewController?
}
2 changes: 1 addition & 1 deletion Sources/StorybookKit/Primitives/BookAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import SwiftUI

public struct BookAction: BookView {

@Environment(\._targetViewController) var targetViewController
@Environment(\.storybook_targetViewController) var targetViewController

public let declarationIdentifier: DeclarationIdentifier

Expand Down
2 changes: 1 addition & 1 deletion Sources/StorybookKit/Primitives/BookPresent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import SwiftUI
/// A component descriptor that just displays UI-Component
public struct BookPresent: BookView {

@Environment(\._targetViewController) private var targetViewController
@Environment(\.storybook_targetViewController) private var targetViewController

public let declarationIdentifier: DeclarationIdentifier
public let presentedViewControllerBlock: @MainActor () -> UIViewController
Expand Down
4 changes: 2 additions & 2 deletions Sources/StorybookKit/Primitives/BookPush.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import SwiftUI
/// A component descriptor that previewing with push presentation.
public struct BookPush: BookView {

@Environment(\._targetViewController) var targetViewController
@Environment(\.storybook_targetViewController) var targetViewController

public let pushingViewControllerBlock: @MainActor () -> UIViewController
public let declarationIdentifier: DeclarationIdentifier
Expand All @@ -44,7 +44,7 @@ public struct BookPush: BookView {

NavigationLink(title, destination: {
_ViewControllerHost(instantiate: pushingViewControllerBlock)
.environment(\._targetViewController, targetViewController)
.environment(\.storybook_targetViewController, targetViewController)
})

}
Expand Down
2 changes: 1 addition & 1 deletion Sources/StorybookKit/StorybookDisplayRootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ final class _ViewController<Content: View>: UIViewController {
let hosting = UIHostingController(
rootView:
content
.environment(\._targetViewController, self)
.environment(\.storybook_targetViewController, self)
)

addChild(hosting)
Expand Down
Loading