ExpandedSurfaceContext

What the host tells expanded-surface content about its mount.

struct ExpandedSurfaceContext

Passed on every render pass, so read the live values rather than caching them. This is the same contract ShelfWidgetContext sets, with the presentation identity added, because a takeover can outlive a single mount.

Initializers

init(availableSize:surface:displayID:isHostShelfTransitioning:isPreview:presentation:)

init(availableSize: CGSize, surface: DropletSurfaceKind = .builtInNotch, displayID: UInt32, isHostShelfTransitioning: Bool = false, isPreview: Bool = false, presentation: ExpandedSurfacePresentation)

Creates a context. Constructed by hosts, read by droplets.

Properties

availableSize

let availableSize: CGSize

The size the host is laying the surface out at. Lay out to this; it is the host's clamped answer to whatever you asked for through expandedSurfaceSize(_:fitting:).

displayID

let displayID: UInt32

The display hosting it.

isHostShelfTransitioning

let isHostShelfTransitioning: Bool

True while the shelf's open or close spring is in flight. Freeze live content while true; host springs never compete with content animation.

isPreview

let isPreview: Bool

True when the view is mounted in a non-interactive preview (settings mockups, the harness screenshot mode). Skip side effects.

presentation

let presentation: ExpandedSurfacePresentation

The presentation this mount belongs to.

surface

let surface: DropletSurfaceKind

The surface kind hosting it.