Skip to content

ComponentInstanceProvider

ctreffs edited this page Oct 8, 2020 · 1 revision

ComponentInstanceProvider

This component provider always returns the same instance of the component. The instance is passed to the provider at initialisation.

public final class ComponentInstanceProvider

Inheritance

ComponentProvider

Initializers

init(instance:)

Initializer

public init(instance: Component)

Parameters

  • instance: The instance to return whenever a component is requested.

Properties

identifier

Used to compare this provider with others. Any provider that returns the same component instance will be regarded as equivalent.

var identifier: AnyHashable

Returns

ObjectIdentifier of instance

Methods

getComponent()

Used to request a component from this provider

public func getComponent() -> Component

Returns

The instance

Clone this wiki locally