Problem Statement
In Swift, what is the main purpose of the Factory Method pattern?
Explanation
The Factory Method defines an interface for creating an object, but lets subclasses decide which class to instantiate. This decouples the code that uses objects from the concrete classes. It is a key creational pattern in Swift architecture discussions.
Practice Sets
This question appears in the following practice sets: