DropletHUDRequest

A transient HUD to show in the notch.

struct DropletHUDRequest

Initializers

init(id:duration:priority:accessibilityLabel:content:)

init(id: String, duration: TimeInterval? = 2.0, priority: DropletHUDPriority = .normal, accessibilityLabel: String, @ViewBuilder content: @escaping @MainActor @Sendable () -> some View)

Properties

accessibilityLabel

let accessibilityLabel: String

Spoken description for VoiceOver.

duration

let duration: TimeInterval?

How long the HUD stays up. nil keeps it until it is replaced or the droplet dismisses it.

id

let id: String

Stable id. A second request with the same id replaces the first in place instead of queueing behind it.

makeContent

let makeContent: @MainActor @Sendable () -> AnyView

The HUD's content. Built on demand and may be rebuilt on layout changes, so keep it a pure function of your model.

@Sendable is explicit rather than inferred. A host compiled with approachable concurrency (SE-0434) treats every global-actor-isolated function type as @Sendable already, while this module's interface is emitted without that feature. Leaving it implicit therefore made the two spellings of the SAME type disagree across the module boundary, and Droppy's own conformance to this protocol failed to compile with a "sendability of function types does not match" error that named no difference a reader could see. Written out, it means one thing everywhere.

priority

let priority: DropletHUDPriority

Priority band.