Tag: Singleton

  • Swift: how to create a Singleton pattern

    Swift: how to create a Singleton pattern

    Written by

    in

    What is a Singleton? A singleton pattern guarantees that only one instance of a class is initialized and available from different points of an app. Some examples are already available in Apple’s frameworks: How to define a Singleton Often a static constant is used to adopt the Singleton pattern. To do that the reference to…

    Read more