Add and remove observer for name

suggest change
// Add observer
// queue: nil runs the block on the posting thread, which may not be the main thread.
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)

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents