STRUCT

HaapiUIPreviewerStyleProvider

Contents

public struct HaapiUIPreviewerStyleProvider

Provides access to resolved theme styles for use in custom view controller previews.

Use this when you have a custom HaapiUIViewController subclass and need to pass themed styles to its constructor in a preview context.

Example usage:

#Preview("Custom Login VC") {
    let styles = try! HaapiUIPreviewer.loadStyles(theme: "MyTheme")
    HaapiUIPreviewerRepresentable {
        let vc = MyCustomLoginViewController(
            myModel,
            style: try styles.formStyle,
            commonStyle: styles.commonStyle
        )
        vc.uiStylableThemeDelegate = styles.themeDelegate
        return vc
    }
}

Properties

commonStyle

public var commonStyle: HaapiUIViewControllerStyle

The common style shared across all view controllers.

formStyle

public var formStyle: FormViewControllerStyle

The style for FormViewController.

selectorStyle

public var selectorStyle: SelectorViewControllerStyle

The style for SelectorViewController.

pollingStyle

public var pollingStyle: PollingViewControllerStyle

The style for PollingViewController.

problemStyle

public var problemStyle: ProblemViewControllerStyle

The style for ProblemViewController.

bankIdStyle

public var bankIdStyle: BankIdViewControllerStyle

The style for BankIdViewController.

flowStyle

public var flowStyle: HaapiFlowViewControllerStyle

The style for HaapiFlowViewController.

genericStyle

public var genericStyle: GenericViewControllerStyle

The style for GenericViewController.

webAuthnStyle

public var webAuthnStyle: WebAuthnViewControllerStyle

The style for WebAuthnViewController.

themeDelegate

public var themeDelegate: UIStylableThemeDelegate

The theme delegate to assign to view controllers for dynamic theming.