DependencyResolver

public protocol DependencyResolver

A DependencyResolver allows to create (resolve) instances of services in a configurable way.

  • Resolves an instance for the supplied type.

    Throws

    Any error initializing the requested type.

    Declaration

    Swift

    func make<T>(_ type: T.Type) throws -> T

    Parameters

    type

    The type type T to resolve.

    Return Value

    An initialized instance of T.

  • Resolves an instance for the supplied type and optional type.

    Throws

    Any error initializing the requested type.

    Declaration

    Swift

    func make<T>(_ type: T.Type, context: DependencyContainer.Scope.Context?) throws -> T

    Parameters

    type

    The type type T to resolve.

    context

    An optional context referencing a shared instance.

    Return Value

    An initialized instance of T.