STRUCT
HaapiUIPreviewerRepresentable
Contents
- Methods
init(_:)makeUIViewController(context:)updateUIViewController(_:context:)
public struct HaapiUIPreviewerRepresentable: UIViewControllerRepresentable
A generic UIViewControllerRepresentable wrapper that bridges UIKit view controllers into SwiftUI
for use in Xcode previews. If the builder closure throws, an error placeholder is displayed instead.
- Experiment: This is an experimental API. It may be changed or removed in the future.
Methods
init(_:)
public init(_ builder: @escaping @MainActor () throws -> UIViewController)
makeUIViewController(context:)
public func makeUIViewController(context: Context) -> UIViewController
Parameters
| Name | Description |
|---|---|
| context | A context structure containing information about the current state of the system. |
updateUIViewController(_:context:)
public func updateUIViewController(_ uiViewController: UIViewController, context: Context)
Parameters
| Name | Description |
|---|---|
| uiViewController | Your custom view controller object. |
| context | A context structure containing information about the current state of the system. |