Clement Clement - 1 year ago 76
Swift Question

Where to remove observer for NSNotification in Swift?

Where should I remove the observer for

in Swift, since
are unavailable?

Answer Source

Use below method which functions same as dealloc.

deinit {
    // Release all recoureces
    // perform the deinitialization

A deinitializer is called immediately before a class instance is deallocated. You write deinitializers with the deinit keyword, similar to how intializers are written with the init keyword. Deinitializers are only available on class types.

Swift Deinitializer

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download