How to Stop Making Singletons in Swift: A Dependency Injection Guide | HackerNoon
This article outlines how to transition from singletons to dependency injection in a SwiftUI app with minimal effort. If you’re here, you likely already know that you should avoid singletons with various of reasons like: Hidden Dependencies: Classes rely on singletons without explicit indicators, making it harder to track app dependencies and leading to unintended coupling. Circular Dependencies: Singletons depending on each other can create cycles, leading to initialization deadlocks as instances wait for each