Are there any reserved keywords for destructors in Swift?
deinit (Deinitialization) handles the cleanup that must occur before an object is released.
Is there a need for such a thing in this language?
There are several standard things in deinit . Remove observers, synchronize the state of the object and write trace messages for debugging. Other things are possible, just avoid long snippets of code.
source share