Is there a way to see if an object is already an observer for a type of notification?
NSNotificationCenter.defaultCenter().removeObserver(self, name: CustomEvent, object: foo)
NSNotificationCenter.defaultCenter().addObserver(self, selector: #("test"), name: CustomEvent, object: foo)
Unfortunately no, there is not. Just like KVO, notification center doesn't provide an API that lets us check whether an observer (
self in this case) has already been registered for a notification or not.