Problem Statement
Which design pattern ensures a class has only one instance and provides a global access point to it?
Explanation
The Singleton pattern restricts instantiation of a class to one object and provides a global point of access to that object. In Swift this is often used for shared managers or services. It’s a fundamental candidate for interview questions about design patterns in Swift.
Practice Sets
This question appears in the following practice sets: