title: Reschedule notification on notification action doesn't work Swift
body: <p>I'm trying to reschedule a notification when user tap on wait notification action.  When <code>triggerNotification()</code> gets called the first time <code>Date</code>is provided by a Date Picker, but when it's called by a response gets the date from a time interval. Inside the <code>didReceiveResponse</code>method <code>case:waitActionIdentifier:</code> I set  <code>newDate</code> and pass that to the <code>triggerNotification</code>parameter. The delayed notification never arrives.
  I don't understand if it's a function calling problem or else because <code>newDate</code>i see is correct by the print of it. 
  Here's the code:</p>
  
  <pre><code>class ViewController: UIViewController {
      @IBAction func datePickerDidSelectNewDate(_ sender: UIDatePicker) {
  
          let selectedDate = sender.date
          let delegate = UIApplication.shared.delegate as? AppDelegate
  //        delegate?.scheduleNotification(at: selectedDate)
          delegate?.triggerNotification(at: selectedDate)
      }
  }
  </code></pre>
  
  <p>and the AppDelegate</p>
  
  <pre><code>import UIKit
  import UserNotifications
  
  @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate {
      var window: UIWindow?
  
  
  
      func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -&gt; Bool {
          // Override point for customization after application launch.
          UNUserNotificationCenter.current().delegate = self
          configureCategory()
          triggerNotification(at: Date())
          requestAuth()
  
          return true
      }
  
  
       let category = "Notification.Category.Read"
  
      private let readActionIdentifier = "Read"
      private let waitActionIdentifier = "Wait"
  
      private func requestAuth() {
          UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { (success, error) in
              if let error = error {
                  print("Request Authorization Failed (\(error), \(error.localizedDescription))")
              }
          }
      }
  
      func triggerNotification(at date: Date) {
          // Create Notification Content
          let notificationContent = UNMutableNotificationContent()
  
          //compone a new Date components because components directly from Date don't work
          let calendar = Calendar(identifier: .gregorian)
          let components = calendar.dateComponents(in: .current, from: date)
          let newComponents = DateComponents(calendar: calendar, timeZone: .current, month: components.month, day: components.day, hour: components.hour, minute: components.minute)
          //create the trigger with above new date components, with no repetitions
          let trigger = UNCalendarNotificationTrigger(dateMatching: newComponents, repeats: false)
  
          // Configure Notification Content
          notificationContent.title = "Hello"
          notificationContent.body = "Kindly read this message."
  
          // Set Category Identifier
          notificationContent.categoryIdentifier = category
  
          // Add Trigger
  //        let notificationTrigger = UNTimeIntervalNotificationTrigger(timeInterval: 10.0, repeats: false)
  
  //        // Create Notification Request
          let notificationRequest = UNNotificationRequest(identifier: "test_local_notification", content: notificationContent, trigger: trigger)
  //
          // Add Request to User Notification Center
          UNUserNotificationCenter.current().add(notificationRequest) { (error) in
              if let error = error {
                  print("Unable to Add Notification Request (\(error), \(error.localizedDescription))")
              }
          }
      }
  
      private func configureCategory() {
          // Define Actions
          let read = UNNotificationAction(identifier: readActionIdentifier, title: "Read", options: [])
          let wait = UNNotificationAction(identifier: waitActionIdentifier, title : "Wait", options: [])
          // Define Category
          let readCategory = UNNotificationCategory(identifier: category, actions: [read, wait], intentIdentifiers: [], options: [])
  
          // Register Category
          UNUserNotificationCenter.current().setNotificationCategories([readCategory])
      }
  
      func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -&gt; Void) {
          completionHandler([.alert])
      }
  
      func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -&gt; Void) {
          switch response.actionIdentifier
          {
          case readActionIdentifier:
             print("Read tapped")
          case waitActionIdentifier:
              let actualDate = Date()
              let newDate: Date = Date(timeInterval: 10, since: actualDate)
              self.triggerNotification(at: newDate)
              print("Wait tapped")
              print(actualDate)
              print(newDate)
          default:
              print("Other Action")
          }
  
          completionHandler()
      }
  
  
  }
  </code></pre>