title: Unique Identifier for scheduling notifications, Swift 3 iOS 10
body: <p>I am scheduling notifications with Unique Identifiers so I don't have to make a new String for each notification. This all works well for scheduling but the problem lies in trying to cancel them.</p>
  <p>This is my code for scheduling notifications...</p>
  <pre><code>let notifIdentifier = TaskManager.notification2.userInfo.description as String!
  let trigger = UNCalendarNotificationTrigger(dateMatching: components , repeats: true)
  let request = UNNotificationRequest(identifier: notifIdentifier! , content: TaskManager.notification2, trigger: trigger)
  UNUserNotificationCenter.current().add(request, withCompletionHandler: nil)
  </code></pre>
  <p>This is the code for cancelling notifications ...</p>
  <pre><code>// Deletion of Cells ...
  
  func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
      
      let managedObject: NSManagedObject = frc.object(at: indexPath) as! NSManagedObject
      context.delete(managedObject)
      if tableView == TaskTableViews {
      let itemController = TaskManager()
      let nItem: List = frc.object(at: indexPath) as! List
      itemController.nItem = nItem
      UNUserNotificationCenter.current().removePendingNotificationRequests(withIdentifiers: [itemController.notifIdentifier!] )
  </code></pre>
  <p>When I try to cancel them, they are very hit and miss. I have tested the code by changing the identifier to a regular String and everything works as it should so its definitely the unique identifier.</p>
  <p>Any thoughts/ suggestions on creating a unique ID for every new task/notification?</p>