Michael Long
Jan 29, 2023

--

If you did `let viewModel: XYZViewModel = Resolver.resolve()` would you expect that value to magically change later on?

That's basically what occurs in @Injected. Calling `reset()` on a scope clears it so that any dependencies in that scope will be created again the next time Resolver is asked to do so.

--

--

Michael Long
Michael Long

Written by Michael Long

I write about Apple, Swift, and SwiftUI in particular, and technology in general. I'm also a Lead iOS Engineer at InRhythm, a modern digital consulting firm.

Responses (1)