Coordinator

class Coordinator(provider: () -> LegendControl.Host?)

A lifecycle utility that facilitates the "Try Install" pattern between a Host and a LegendControl.

It ensures that the control is initialized only on the Main thread and manages ownership state to prevent memory leaks or duplicate installations.

Parameters

provider

A lambda returning the Host responsible for displaying the legend.

Constructors

Link copied to clipboard
constructor(provider: () -> LegendControl.Host?)

Properties

Link copied to clipboard

Functions

Link copied to clipboard

Disconnects the LegendControl from the host. If the coordinator created the control (isControlOwned), it will be fully removed.

Link copied to clipboard

Connects the Coordinator to the Host, creating and installing a LegendControl if one doesn't already exist.