title: Can we schedule UNUserNotificationCenter only in specific view controller in iOS?
body: <p>I want to show notification only in specific pages like if the userid obtained from payload of notification is not equal to the current userid. Where should I use this condition inside appdelegate? I have used <em>willPresent</em> delegate of <code>userNotificationCenter</code> to deliver the notification when app is in foreground and requesting permission to show notification method in <code>didFinishLauchingWithOptions</code> in <code>AppDelegate</code>.</p>
  
  <p>Sample code of <em>willPresent</em> method is given below.</p>
  
  <pre><code>func userNotificationCenter(_ center: UNUserNotificationCenter,
                              willPresent notification: UNNotification,
                              withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -&gt; Void){
  
      if let userID = notification.request.content.userInfo["user_id"] {
          self.userIDSelected = userID as! String
      }
      let notificationCenter = UNUserNotificationCenter.current()
      notificationCenter.removeAllDeliveredNotifications()
      if self.currentuserID != self.userIDSelected
      {
          completionHandler([.alert,.badge,.sound])
      }
      else
      {
           completionHandler([])
      }
  }
  </code></pre>