Skip to content
Josh Wright edited this page Jan 14, 2021 · 4 revisions

Inject

Provides a convenient @propertyWrapper for injecting services to a type. By default, resolves services from the global container (Container.global) but if the enclosing type conforms to Containerized services are resolved from EnclosingType.container.

@propertyWrapper public class Inject<Service>

Initializers

init()

Create the property wrapper with no identifier.

public init()

init(_:)

Create the property wrapper with an identifier.

public init<H: Hashable>(_ identifier: H)

Parameters

  • identifier: The identifier of the service to load.

Properties

wrappedValue

An instance of the service this property wrapper is injecting.

var wrappedValue: Service
Alchemy
Types
Protocols
Global Typealiases
Global Variables
Global Functions
Fusion
Types
Protocols
Papyrus
Types
Protocols
Clone this wiki locally