title: Is it possible to mutate the content of a local notification in swift?
body: <p>In the next version of my app, I want to integrate the possibility that the user can enable weekly reports like the screentime feature from apple.</p>
  
  <p>I know how to setup Local Notifications (The code is already working for other types of notifications like reminders for events), but for this idea, I need the notification text to be updated shortly before firing because I don`t know the exact content of the notification when I add it to the NotificationCenter.</p>
  
  <p>Is there a function which is called shortly before firing or how would I do this?</p>
  
  <p>This is my working code for scheduling notifications:</p>
  
  <pre><code>fileprivate func generateNotification(title: String, body: String, triggerDate: DateComponents) -&gt; String{
     //Trigger
     let trigger = UNCalendarNotificationTrigger(dateMatching: triggerDate, repeats: false)
  
     //Content
     let content = UNMutableNotificationContent()
     content.title = title
     content.body = body
     content.sound = UNNotificationSound.default
  
     //Request
     let identifier = UUID().uuidString
     let request = UNNotificationRequest(identifier: identifier, content: content, trigger: trigger)
  
     let notificationCenter = UNUserNotificationCenter.current()
     notificationCenter.add(request) { (error) in
         if let error = error {
             print("Error \(error.localizedDescription)")
         }
     }
  
     return identifier
  }
  </code></pre>