Starting with ios 9 it is not necessary to unsubscribe from notification center since ios handles this automatically, but prior to ios 9 developers had to manually call NotificationCenter.default.removeObserver(self) in order to avoid memory leaks and common place for this was(it is suggested in a lot of tutorials and Stackoverflow posts) deinit. So, my question is - how it was possible to use deinit to unregister from notifications since deinit is only called before objects deallocation, so its ref count should be 0, but for sure it is not - since we're still subscribe to the notification center. The only possible way to achieve this seems to be use of weak references, basically if notification center references object weakly the above mentioned scenario is possible, but in this case unsubscribing is not needed at all since the object can be easily deallocated. Can somebody clarify a bit on how this works.