Articles, podcasts and news about Swift development, by John Sundell.
Radek Pietruszewski, software writer at Nozbe and creator of SwiftyUserDefaults, joins John to talk about developer seniority, being inspired by the React paradigm, singletons & dependency injection, micro features and much more.
There seems to almost be a consensus in the community that singletons are "bad", but at the same time both Apple and third party Swift developers keep using them both internally within apps and in shared frameworks. This week, let's take a look at exactly what the problems are with using singletons, and explore some techniques that can be used to avoid them.
Most apps written for any of Apple’s platforms rely on APIs that are singleton-based. From UIScreen to UIApplication to NSDate, static APIs are everywhere in Foundation, UIKit and AppKit. In this article I'll go through 3 steps to easily test code that uses such APIs.