I've got a base class. In this base class I take some callbacks in the init method. In these callbacks I'd like to reference the derived class's self
. However, Swift complains that the lambdas reference self
before super.init
. Of course, I know that in reality, the base class doesn't invoke the callbacks actually inside super.init
and even if it did, that's not clearly illegal, since it would not be before super.init
.
How can I pass a callback to super.init
that references self
?