I'm trying to register CoreDataStack as a single instance on a shared container with object scope .container
, but its factory closure called multiple times and when I debug memory graph in Xcode several instances of the object are created even when the returned object is not value-type!
Swinject documentation:
The object scope is ignored if the factory closure returns a value type because its instance is never shared per the Swift specification.
What is the root cause of this strange behavior?