Structures
The following structures are available globally.
-
Immediate injection property wrapper.
Wrapped dependent service is resolved immediately using Resolver.root upon struct initialization.
See moreDeclaration
Swift
@propertyWrapper public struct Injected<Service>
-
OptionalInjected property wrapper.
If available, wrapped dependent service is resolved immediately using Resolver.root upon struct initialization.
See moreDeclaration
Swift
@propertyWrapper public struct OptionalInjected<Service>
-
Lazy injection property wrapper. Note that embedded container and name properties will be used if set prior to service instantiation.
Wrapped dependent service is not resolved until service is accessed.
See moreDeclaration
Swift
@propertyWrapper public struct LazyInjected<Service>
-
Weak lazy injection property wrapper. Note that embedded container and name properties will be used if set prior to service instantiation.
Wrapped dependent service is not resolved until service is accessed.
See moreDeclaration
Swift
@propertyWrapper public struct WeakLazyInjected<Service>
-
Immediate injection property wrapper for SwiftUI ObservableObjects. This wrapper is meant for use in SwiftUI Views and exposes bindable objects similar to that of SwiftUI @observedObject and @environmentObject.
Dependent service must be of type ObservableObject. Updating object state will trigger view update.
Wrapped dependent service is resolved immediately using Resolver.root upon struct initialization.
See moreDeclaration
Swift
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) @propertyWrapper public struct InjectedObject<Service> : DynamicProperty where Service : ObservableObject