OverlayWindowPresenter

@MainActor
public final class OverlayWindowPresenter

A singleton class responsible for managing a separate UIWindow to display an overlay alert on top of all views, including modals.

  • Undocumented

    Declaration

    Swift

    @MainActor
    public init()
  • Returns true when there is already an overlay currently being shown, otherwise false.

    Declaration

    Swift

    @MainActor
    public var isOverlayAlertVisible: Bool { get }
  • Displays an overlay alert by creating a new UIWindow and setting a SwiftUI view as its root.

    Does nothing if there is already an overlay alert active.

    Declaration

    Swift

    @MainActor
    public func present(view: some View)

    Parameters

    view

    The SwiftUI View to be displayed as an overlay.

  • Same as presentOverlayWindow(view:), but with a ViewBuilder to accept in-line view creation.

    Declaration

    Swift

    @MainActor
    public func present(@ViewBuilder content: () -> some View)

    Parameters

    content

    The SwiftUI View to be displayed as an overlay.

  • Dismisses the currently displayed overlay alert and removes the temporary window.

    Declaration

    Swift

    @MainActor
    public func dismiss()