Why is Singleton Swift bad?

Why is Singleton Swift bad?
Answer
The three main reasons why I tend to avoid singletons are: They are global mutable shared state. Their state is automatically shared across the entire app, and bugs can often start occurring when that state changes unexpectedly.
 

Tìm kiếm

Back
Top