Norway


In the 2nd part of this communication patterns , he uses observers.

He mentions the up as a downside compared to delegate pattern. However, it never gets called in the example given.

https://www.youtube.com/watch?v=srqiDnLEocA

deinit {
    NotificationCenter.default.removeObserver(self)
}

Should it be cleaned up when you no longer need it?

Q. how do you remove just ONE observer? You can have several listeners to one observer, so how do you remove one listener and then one observer?

All I got to work was remove Observer(self) and that removes everything.

Also, is there a way to get a list of active observers?



Source link

LEAVE A REPLY

Please enter your comment!
Please enter your name here