I\'ve been trying to find an example, but what I\'ve seen doesn\'t work in my case.
What would be the equivalent of the following code:
object.addObserv
To add something to the answer as I experienced crashes on my app when using this method in iOS 10.
In iOS 10, you still need to remove the observer before deallocating the class or otherwise you will get a crash NSInternalInconsistencyException stating that:
An instance
Aof ClassCwas deallocated while key value observers were still registered with it.
To avoid this crash. Simply set the observer property that you're using to nil.
deinit {
self.observation = nil
}