O'Reilly logo

Reactive Programming with Swift 4 by Navdeep Singh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Design patterns

We will go through a quick inventory of common design patterns that are used most extensively while working with iOS apps. The first design pattern we will look at is the two stage Object creation; it divides the process into separate memory allocation and initialization steps. This might appear cumbersome, but as we will see later, it allows greater flexibility in how we customize initialization methods. This facilitates code reuse both within classes and between classes in the inheritance hierarchy; then we will look at Singletons.

The Singleton pattern encapsulates a shared resource within a single unique class instance. This instance arbitrates access to the resource and storage-related state information. A class method ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required