Рет қаралды 1,139
The builder pattern isn't a common pattern in Swift and Cocoa development and you don't find it in any of Apple's frameworks. It is one of the Gang of Four design patterns and widely used in Java development.
As the name suggests, the builder pattern is aimed at object creation and configuration. The idea is simple. You pass the requirements of the object you want to create to a builder. The builder uses those requirements to create and configure the object. You could see the builder as a factory that is capable of creating a range of variations or representations of one or more types.