Junior — Middle
Can you list standard design patterns used in Swift?
sobes.tech AI
Answer from AI
In Swift, common design patterns include:
- Singleton — for creating a single instance of a class accessible globally.
- Delegate — for passing events and data between objects, often used in UIKit.
- Observer — for subscribing to changes in object states (e.g., via NotificationCenter).
- Factory — for creating objects without specifying the exact class.
- MVC (Model-View-Controller) — a widely used architectural pattern in iOS development.
- Builder — for step-by-step creation of complex objects.
These patterns help organize code, improve maintainability, and extendability.