OptionalInjected
@propertyWrapper
public struct OptionalInjected<Service>
Injects and resolves an optional service immediately.
-
A wrapped value.
Declaration
Swift
public var wrappedValue: Service? { get set }
-
Initializes a new instance of a service with one argument.
Declaration
Swift
public init<Arg1>( resolver: Resolver = .main, name: String? = nil, arguments arg1: Arg1 )
Parameters
resolver
An instance of
Resolver
. Defaults tomain
.name
The name of a service. Defaults to
nil
.arg1
The first argument of a service.
-
Initializes a new instance of a service with two arguments.
Declaration
Swift
public init<Arg1, Arg2>( resolver: Resolver = .main, name: String? = nil, arguments arg1: Arg1, _ arg2: Arg2 )
Parameters
resolver
An instance of
Resolver
. Defaults tomain
.name
The name of a service. Defaults to
nil
.arg1
The first argument of a service.
arg2
The second argument of a service.
-
Initializes a new instance of a service with three arguments.
Declaration
Swift
public init<Arg1, Arg2, Arg3>( resolver: Resolver = .main, name: String? = nil, arguments arg1: Arg1, _ arg2: Arg2, _ arg3: Arg3 )
Parameters
resolver
An instance of
Resolver
. Defaults tomain
.name
The name of a service. Defaults to
nil
.arg1
The first argument of a service.
arg2
The second argument of a service.
arg3
The third argument of a service.
-
Initializes a new instance of a service with four arguments.
Declaration
Swift
public init<Arg1, Arg2, Arg3, Arg4>( resolver: Resolver = .main, name: String? = nil, arguments arg1: Arg1, _ arg2: Arg2, _ arg3: Arg3, _ arg4: Arg4 )
Parameters
resolver
An instance of
Resolver
. Defaults tomain
.name
The name of a service. Defaults to
nil
.arg1
The first argument of a service.
arg2
The second argument of a service.
arg3
The third argument of a service.
arg4
The fourth argument of a service.
-
Initializes a new instance of a service with five arguments.
Declaration
Swift
public init<Arg1, Arg2, Arg3, Arg4, Arg5>( resolver: Resolver = .main, name: String? = nil, arguments arg1: Arg1, _ arg2: Arg2, _ arg3: Arg3, _ arg4: Arg4, _ arg5: Arg5 )
Parameters
resolver
An instance of
Resolver
. Defaults tomain
.name
The name of a service. Defaults to
nil
.arg1
The first argument of a service.
arg2
The second argument of a service.
arg3
The third argument of a service.
arg4
The fourth argument of a service.
arg5
The fifth argument of a service.
-
Initializes a new instance of a service with six arguments.
Declaration
Swift
public init<Arg1, Arg2, Arg3, Arg4, Arg5, Arg6>( resolver: Resolver = .main, name: String? = nil, arguments arg1: Arg1, _ arg2: Arg2, _ arg3: Arg3, _ arg4: Arg4, _ arg5: Arg5, _ arg6: Arg6 )
Parameters
resolver
An instance of
Resolver
. Defaults tomain
.name
The name of a service. Defaults to
nil
.arg1
The first argument of a service.
arg2
The second argument of a service.
arg3
The third argument of a service.
arg4
The fourth argument of a service.
arg5
The fifth argument of a service.
arg6
The sixth argument of a service.
-
Initializes a new instance of a service with seven arguments.
Declaration
Swift
public init<Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7>( resolver: Resolver = .main, name: String? = nil, arguments arg1: Arg1, _ arg2: Arg2, _ arg3: Arg3, _ arg4: Arg4, _ arg5: Arg5, _ arg6: Arg6, _ arg7: Arg7 )
Parameters
resolver
An instance of
Resolver
. Defaults tomain
.name
The name of a service. Defaults to
nil
.arg1
The first argument of a service.
arg2
The second argument of a service.
arg3
The third argument of a service.
arg4
The fourth argument of a service.
arg5
The fifth argument of a service.
arg6
The sixth argument of a service.
arg7
The seventh argument of a service.
-
Initializes a new instance of a service with eight arguments.
Declaration
Swift
public init<Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8>( resolver: Resolver = .main, name: String? = nil, arguments arg1: Arg1, _ arg2: Arg2, _ arg3: Arg3, _ arg4: Arg4, _ arg5: Arg5, _ arg6: Arg6, _ arg7: Arg7, _ arg8: Arg8 )
Parameters
resolver
An instance of
Resolver
. Defaults tomain
.name
The name of a service. Defaults to
nil
.arg1
The first argument of a service.
arg2
The second argument of a service.
arg3
The third argument of a service.
arg4
The fourth argument of a service.
arg5
The fifth argument of a service.
arg6
The sixth argument of a service.
arg7
The seventh argument of a service.
arg8
The eighth argument of a service.
-
Initializes a new instance of a service with nine arguments.
Declaration
Swift
public init<Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9>( resolver: Resolver = .main, name: String? = nil, arguments arg1: Arg1, _ arg2: Arg2, _ arg3: Arg3, _ arg4: Arg4, _ arg5: Arg5, _ arg6: Arg6, _ arg7: Arg7, _ arg8: Arg8, _ arg9: Arg9 )
Parameters
resolver
An instance of
Resolver
. Defaults tomain
.name
The name of a service. Defaults to
nil
.arg1
The first argument of a service.
arg2
The second argument of a service.
arg3
The third argument of a service.
arg4
The fourth argument of a service.
arg5
The fifth argument of a service.
arg6
The sixth argument of a service.
arg7
The seventh argument of a service.
arg8
The eighth argument of a service.
arg9
The ninth argument of a service.
-
Initializes a new instance of a service with ten arguments.
Declaration
Swift
public init<Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9, Arg10>( resolver: Resolver = .main, name: String? = nil, arguments arg1: Arg1, _ arg2: Arg2, _ arg3: Arg3, _ arg4: Arg4, _ arg5: Arg5, _ arg6: Arg6, _ arg7: Arg7, _ arg8: Arg8, _ arg9: Arg9, _ arg10: Arg10 )
Parameters
resolver
An instance of
Resolver
. Defaults tomain
.name
The name of a service. Defaults to
nil
.arg1
The first argument of a service.
arg2
The second argument of a service.
arg3
The third argument of a service.
arg4
The fourth argument of a service.
arg5
The fifth argument of a service.
arg6
The sixth argument of a service.
arg7
The seventh argument of a service.
arg8
The eighth argument of a service.
arg9
The ninth argument of a service.
arg10
The tenth argument of a service.