DropletSettingsPageOpener

How a DropletSettingsPageLink asks the host for a page (DroppyKit 1.13.0).

struct DropletSettingsPageOpener

The host puts one in the environment of your pane and of every page it opens. Read it through @Environment(\.dropletSettingsPageOpener) only for a control that is not a link row; a DropletSettingsPageLink does this for you. nil outside Droppy (the harness, a host older than 1.13.0).

Initializers

init(_:)

init(_ action: @escaping @MainActor @Sendable (_ pageID: String, _ title: String) -> Void)

Creates an opener. Constructed by hosts.

init(_:tile:)

init(_ action: @escaping @MainActor @Sendable (_ pageID: String, _ title: String) -> Void, tile: @escaping @MainActor @Sendable (_ pageID: String) -> AnyView?)

Creates an opener that also draws the tile of some of the droplet's links in the host's own icon (DroppyKit 1.21.0). Hosts only.

tile returns the host's tile for the link to a page id, drawn at tileSize, or nil to keep the tile the droplet draws. Droppy uses it to give a Store droplet's links its Settings icons, which follow the user's icon style, while that droplet's bundle still ships flat tiles: a link's body is the host's framework, so the droplet needs no rebuild.

Methods

callAsFunction(page:title:)

@MainActor func callAsFunction(page id: String, title: String)

Opens the page id names, under title in the toolbar.

tile(forPage:)

@MainActor func tile(forPage id: String) -> AnyView?

The host's tile for the link to the page id names, or nil when the link draws its own (DroppyKit 1.21.0).