Using Builder Pattern in Swift#
Like other abstractions and patterns in programming, the purpose of the builder pattern is to reduce complexity by maintaining mutable state, making objects simpler and easier to predict. When objects have "less state", they become easier to test and debug because their logic only relies on pure input and output.
Although the builder pattern is common in Java, it is rarely encountered on the Apple platform (at least in terms of building objects). This week, let's take a look at how to use the builder pattern in Swift.