Skip to main content

render_sheet

Function render_sheet 

Source
pub fn render_sheet(
    view: &ViewHandle,
    win_w: u32,
    win_h: u32,
    w: u32,
    h: u32,
) -> Rendered
Expand description

Present view in a real window and capture the sheet it puts up, not the window itself.

.alert, .sheet and .confirmationDialog on macOS present into a separate child window attached to the parent. Capturing the parent shows only that it dimmed; capturing the sheet shows the dialog SwiftUI actually built, which is what the modifier is for.

Returns a single flat pixel if nothing was presented, so a case that silently stopped presenting shows up as flat rather than passing.