STRUCT

HaapiUIPreviewerRepresentable

Contents

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.

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.