Setting lazy static variable first initializes then assigns?
问题 I realize that static variables are implicitly lazy , which is really great. Doing the below will not create the instance until it's first called: static var test = Test() However, assigning a new instance to the static variable initializes the original, then assigns the new instance which is troubling for me: SomeType.test = AnotherTest() //Initializes Test then AnotherTest type To give more context on what I'm trying to do, I'm trying to setup a pure Swift dependency injection using this