title: How would I re add a notification request if I previously removed it from the pending requests?
body: <p>I have a reminder app and currently if I delete a reminder it also removes the notification if the reminder has a date or time associated with it which you can see in the LocalNotificationManager below. now I want to remove a reminder as well if the user checks off the reminder but doesn't delete it and you can see this in my reminderView in the ontapGesture I have but if they check it again setting it back to not completed I need it to re add the same notification request back so that the notification will go off. I have both the LocalNotificationManager and the reminderView code below as well as my reminder model. any help would be great!</p>
  <p>Reminder Model</p>
  <p>'''</p>
  <pre><code>struct Reminder: Identifiable, Equatable {
  var title: String
  var notes: String?
  var date: Date?
  var time: Date?
  var theme: Theme
  var iscomplete: Bool
  var priority: RemindPriority
  let id: UUID
  //let filter: FilterType
  
  init(title: String, notes: String? = nil, date: Date? = nil, time: Date? = nil, theme: Theme, iscomplete: Bool = false, priority: RemindPriority = .None, id: UUID = UUID()) {
      self.title = title
      self.notes = notes
      self.date = date
      self.time = time
      self.theme = theme
      self.iscomplete = iscomplete
      self.priority = priority
      self.id = id
  }
  
  /*var filteredReminders: [Reminder] {
      switch filter {
      case .all:
          return HomeViewModel().reminds
      case .today:
          return HomeViewModel().reminds.filter($0.date.)
      }
  }*/
  
  func formatDate(date: Date) -&gt; String {
      let formatter = DateFormatter()
      formatter.dateStyle = .full
      formatter.timeStyle = .none
      
      return formatter.string(from: date)
  }
  
  func formatTime(time: Date) -&gt; String {
      let formatter = DateFormatter()
      formatter.dateStyle = .none
      formatter.timeStyle = .short
      
      return formatter.string(from: time)
  }   
  }
  </code></pre>
  <p>'''</p>
  <p>ReminderView</p>
  <p>'''</p>
  <pre><code>import SwiftUI
  
  struct ReminderView: View {
  @ObservedObject var remindVM: ReminderViewModel
  
  init(remind: Binding&lt;Reminder&gt;) {
      remindVM = ReminderViewModel(remind: remind)
  }
   
  
  var body: some View {
      VStack {
          HStack {
              Image(systemName: remindVM.remind.iscomplete ? &quot;circle.fill&quot; : &quot;circle&quot;)
                  .font(.title)
                  .onTapGesture {
                      remindVM.remind.iscomplete.toggle()
                      if remindVM.remind.iscomplete {
                          LocalNotificationManager().deleteLocalNotifications(identifiers: [remindVM.remind.id.uuidString])
                          
                      } else {
                          
                      }
                  }
              Text(remindVM.remind.priority.name)
                  .font(.title)
                  .foregroundColor(remindVM.remind.theme.accentColor)
                  
              if !remindVM.remind.iscomplete {
                  Text(remindVM.remind.title)
                      .font(.title)
              } else {
                  Text(remindVM.remind.title)
                      .font(.title)
                      .opacity(0.7)
              }
              Spacer()
          }
       }
    }
  </code></pre>
  <p>'''</p>
  <p>LocalNotificationManager</p>
  <p>'''</p>
  <pre><code>import Foundation
  import SwiftUI
  
  class LocalNotificationManager: ObservableObject {
  @Published var deletedNotifications: [UNNotificationRequest] = []
  
  init() {
      UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { granted, error in
          if granted == true &amp;&amp; error == nil {
              print(&quot;Notifications are allowed&quot;)
          } else {
              print(&quot;Notifications are not allowed&quot;)
          }
      }
  }
  
  func sendNotification(date: Date, type: String, timeInterval: Double = 10, title: String, body: String, id: UUID) {
      var trigger: UNNotificationTrigger?
      
      if type == &quot;date&quot; {
          let dateComponents = Calendar.current.dateComponents([.day, .month, .year, .hour, .minute], from: date)
          trigger = UNCalendarNotificationTrigger(dateMatching: dateComponents, repeats: false)
      } else if type == &quot;time&quot; {
          trigger = UNTimeIntervalNotificationTrigger(timeInterval: timeInterval, repeats: false)
      }
      
      UNUserNotificationCenter.current().removePendingNotificationRequests(withIdentifiers: [id.uuidString])
      
      let content = UNMutableNotificationContent()
      content.title = title
      content.body = body
      content.sound = UNNotificationSound.default
      //content.badge = (notifications.count) as NSNumber
      
      let request = UNNotificationRequest(identifier: id.uuidString, content: content, trigger: trigger)
      
      UNUserNotificationCenter.current().add(request)
      
      //notifications.append(request)
  }
  
  func deleteLocalNotifications(identifiers: [String]) {
      UNUserNotificationCenter.current().removePendingNotificationRequests(withIdentifiers: identifiers)
  }
  
  }
  </code></pre>
  <p>'''</p>