Scope

public enum Scope : String, CaseIterable, CustomStringConvertible

A configuration option that determines how a new instance of a service is created.

  • Creates one instance that exists for lifetime of an app or until the cache is reset or it is evicted from the cache due to memory pressure.

    Declaration

    Swift

    case cached
  • Creates one instance during a given resolution cycle.

    Declaration

    Swift

    case graph
  • Creates one instance that exists while a strong reference to it exists. Only works with reference types.

    Declaration

    Swift

    case shared
  • Creates one instance that exists for lifetime of an app.

    Declaration

    Swift

    case singleton
  • Always creates a new instance.

    Declaration

    Swift

    case unique
  • See CustomStringConvertible.

    Declaration

    Swift

    public var description: String { get }