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
resolverAn instance of
Resolver. Defaults tomain.nameThe name of a service. Defaults to
nil.arg1The 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
resolverAn instance of
Resolver. Defaults tomain.nameThe name of a service. Defaults to
nil.arg1The first argument of a service.
arg2The 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
resolverAn instance of
Resolver. Defaults tomain.nameThe name of a service. Defaults to
nil.arg1The first argument of a service.
arg2The second argument of a service.
arg3The 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
resolverAn instance of
Resolver. Defaults tomain.nameThe name of a service. Defaults to
nil.arg1The first argument of a service.
arg2The second argument of a service.
arg3The third argument of a service.
arg4The 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
resolverAn instance of
Resolver. Defaults tomain.nameThe name of a service. Defaults to
nil.arg1The first argument of a service.
arg2The second argument of a service.
arg3The third argument of a service.
arg4The fourth argument of a service.
arg5The 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
resolverAn instance of
Resolver. Defaults tomain.nameThe name of a service. Defaults to
nil.arg1The first argument of a service.
arg2The second argument of a service.
arg3The third argument of a service.
arg4The fourth argument of a service.
arg5The fifth argument of a service.
arg6The 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
resolverAn instance of
Resolver. Defaults tomain.nameThe name of a service. Defaults to
nil.arg1The first argument of a service.
arg2The second argument of a service.
arg3The third argument of a service.
arg4The fourth argument of a service.
arg5The fifth argument of a service.
arg6The sixth argument of a service.
arg7The 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
resolverAn instance of
Resolver. Defaults tomain.nameThe name of a service. Defaults to
nil.arg1The first argument of a service.
arg2The second argument of a service.
arg3The third argument of a service.
arg4The fourth argument of a service.
arg5The fifth argument of a service.
arg6The sixth argument of a service.
arg7The seventh argument of a service.
arg8The 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
resolverAn instance of
Resolver. Defaults tomain.nameThe name of a service. Defaults to
nil.arg1The first argument of a service.
arg2The second argument of a service.
arg3The third argument of a service.
arg4The fourth argument of a service.
arg5The fifth argument of a service.
arg6The sixth argument of a service.
arg7The seventh argument of a service.
arg8The eighth argument of a service.
arg9The 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
resolverAn instance of
Resolver. Defaults tomain.nameThe name of a service. Defaults to
nil.arg1The first argument of a service.
arg2The second argument of a service.
arg3The third argument of a service.
arg4The fourth argument of a service.
arg5The fifth argument of a service.
arg6The sixth argument of a service.
arg7The seventh argument of a service.
arg8The eighth argument of a service.
arg9The ninth argument of a service.
arg10The tenth argument of a service.
View on GitHub
Install in Dash