Creational Patterns
Now that we've refreshed ourselves on the basics of Swift programming, we can get started with the first series of design patterns: creational patterns.
We use creational patterns to hide the complexity of creating instances of fully featured objects, decouple different part of your applications, and gear your code toward high maintainability.
In this chapter, we'll dive into those traditional patterns, from theoretical to concrete examples, through detailed use cases. We'll see how they're adapted from traditional languages such as Java, and how we can enhance them with the unique features of Swift.
We'll start with two very common and widespread patterns, the singleton and the lazy initialization. We'll follow up through ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access