title: Notification Center Posting Notification with User-Info
body: <p>For my code base, I have 3 functions and 3 dispatch groups (dg)</p>
  <p>so when the 1st function is done, dg1's notify method is called and it calls func 2, and once that is done, dg2's notify method is called and func 3 is called once that is finished dg3's notify is called, I have my data and I use it for further processing.</p>
  <p>All the above logic is in another file</p>
  <p>I want to pass the data is of func 3, available in dg3's notify-execute method to my vc. I employed the notification center for this method. Using the following:</p>
  <pre><code> let imageDataDict:[String: UIImage] = [&quot;image&quot;: image]
  
    // post a notification
    NotificationCenter.default.post(name: NSNotification.Name(rawValue: &quot;notificationName&quot;), object: nil, userInfo: imageDataDict) 
    // `default` is now a property, not a method call
  
   // Register to receive notification in your class
   NotificationCenter.default.addObserver(self, selector: #selector(self.showSpinningWheel(_:)), name: NSNotification.Name(rawValue: &quot;notificationName&quot;), object: nil)
  
   // handle notification
   // For swift 4.0 and above put @objc attribute in front of function Definition  
   func showSpinningWheel(_ notification: NSNotification) {
  
    if let image = notification.userInfo?[&quot;image&quot;] as? UIImage {
    // do something with your image   
    }
   }
  </code></pre>
  <p>However I never get the notification. How do I resolve this problem. I want to pass the data from the dispatch group elsewhere -in this case my VC.</p>