Hector Matos covers the various iterations of writing a singleton in Swift:
“The Singleton. The problem we find in Swift is that there are SEVERAL ways of implementing them. But which way is the right way? In this post I’m going to show you the history of the singleton and then show you the right way to implement the singleton in Swift.”
Stackoverflow inspiration for the one line singleton.