title: Swift - UNNotification center
body: <p>I have multiple controllers:</p>
  
  <ul>
  <li><code>Home VC</code></li>
  <li><code>MyNotifVC</code></li>
  </ul>
  
  <p>In <code>myNotifVC</code> I have a list of all the pending notification.</p>
  
  <p>I am trying to update the number of notification in <code>HomeVC</code> as the notifications are delivered.</p>
  
  <p>So basically I would like to update a var (<code>var deliveredNotif: Int</code>) in <code>HomeVC</code> as soon as a notification is delivered (independently from which controller is active).</p>
  
  <p>So far in <code>myNotifVC</code> i have:</p>
  
  <pre><code>     func getDeliveredNotif(){
      UNUserNotificationCenter.current().getDeliveredNotifications(completionHandler: {deliveredNotifications -&gt; () in
          if let notifVC = self.presentingViewController as? HomeVC {
              notifVC.delivered = deliveredNotifications.count
          }
      })
  }
  </code></pre>
  
  <p>How can I store in my var delivered (which is declared in my <code>HomeVC</code>) the number of delivered notification either if <code>HomeVC</code> is running or as soon as it will be running?</p>
  
  <p>Thank you!</p>