Contents

reporter(for:stableMetadata:volatileMetadata:)

Returns the reporter instance unique to the given domain and metadata types.

Declaration

static func reporter(for domain: String, stableMetadata stableMetadataType: StableMetadata.Type = Never.self, volatileMetadata volatileMetadataType: VolatileMetadata.Type = Never.self) -> StateReporter<StableMetadata, VolatileMetadata>

Parameters

  • domain:

    The reverse DNS-style domain name.

  • stableMetadataType:

    The type to use for stable metadata (defaults to Never).

  • volatileMetadataType:

    The type to use for volatile metadata (defaults to Never).

Mentioned in

Return Value

The reporter instance for the specified domain.

Discussion

This method is the only way to obtain a StateReporter. Calling it multiple times with the same domain string always returns the same object. Calling it with a domain string that was previously registered under different generic type arguments is a fatal error.