Add and remove observer for name
suggest change// Add observer
let observer = NSNotificationCenter.defaultCenter().addObserverForName("nameOfTheNotification", object: nil, queue: nil) { (notification) in
// Do operations with the notification in this block
}
// Remove observer
NSNotificationCenter.defaultCenter().removeObserver(observer)
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents