DropletInstallState

Which of this droplet's pieces the user currently has switched on.

struct DropletInstallState

Initializers

init(isEnabled:activeWidgetIDs:)

init(isEnabled: Bool, activeWidgetIDs: Set<ShelfWidgetID> = [])

Properties

activeWidgetIDs

let activeWidgetIDs: Set<ShelfWidgetID>

The widget ids the user has placed on a shelf layout.

In Droppy after 16.0.1 these are the droplet's widgets on the user's Custom Shelf, and only widgets the droplet currently declares. One the user adds in the shelf editor joins at once; one they remove there leaves when they click Done, since a Cancel puts it back. The Widgets page lists every widget and is not a placement, and neither is a widget opened on its own from a favorite or a shortcut: use the widget view's lifecycle and DropletShelfService for whether it is on screen.

Droppy 16.0.1 and earlier, and Droppy Playground built from them, always report an empty set, so treat empty as unknown rather than as "not placed" for as long as you support those versions.

isEnabled

let isEnabled: Bool

Whether the droplet is enabled at all.

Droppy runs only enabled droplets, so this is true for as long as the droplet runs. Droppy after 16.0.1 sets it to false just before the user switches the droplet off or removes it, ahead of deactivate().