I am following the The Swift Programming Language book to investigate strong reference cycle. One of the examples that should be working cannot be compiled in Xcode. I don't understand why the code is broken.
On this chapter, there is an example that looks like this:
When I try to compile this code in Xcode the this error was thrown: 'self' used before all stored properties are initialized. However, I think it should have been able to compile because I set capitalCity to be Implicitly Unwrapped Optionals that is nil by default, so after I set self.name = name all stored properties should be already properly set.
What do I miss here? What changes are needed to make the code compile?
Thanks in advance!