title: Repeating local notifications for specific days of week (Swift 3 IOS 10)
body: <p>I am trying to schedule local notifications for specific days of week (e.g. Monday, Wednesday and etc) and then repeat them weekly.
  This is how the screen for setting notifications looks:</p>
  <p><a href="https://i.stack.imgur.com/EZPnp.png" rel="noreferrer"><img src="https://i.stack.imgur.com/EZPnp.png" alt="enter image description here" /></a></p>
  <p>User can select time for the notification and repeating days.</p>
  <p>My method for scheduling single non repeating notification looks like this:</p>
  <pre><code>static func scheduleNotification(reminder: Reminder) {
      // Setup notification content.
      let content = UNMutableNotificationContent()
      
      //content.title = NSString.localizedUserNotificationString(forKey: &quot;Reminder&quot;, arguments: nil)
      content.body = NSString.localizedUserNotificationString(forKey: reminder.reminderMessage, arguments: nil)
      content.sound = UNNotificationSound.default()
      
      
      // Configure the triger for specified time.
      // 
      let dateComponentes = reminder.dateComponents
      // TODO: Configure repeating alarm
      
      // For the testing purposes we will not repeat the reminder
      let trigger = UNCalendarNotificationTrigger(dateMatching: dateComponentes, repeats: false)
      
      // Create the request object.
      let request = UNNotificationRequest(identifier: &quot;\(reminder.reminderId)&quot;, content: content, trigger: trigger)
      
      // Schedule the request.
      let notificationCenter = UNUserNotificationCenter.current()
      notificationCenter.add(request) { (error: Error?) in
          if let theError = error {
              print(theError.localizedDescription)
          }
      }
  }
  </code></pre>
  <p>The date components are extracted from UIDatePicker widget and stored in reminder class:</p>
  <pre><code>let date = reminderTimeDatePicker.date.addingTimeInterval(60 * 60 * 24 * 7)
  let components = Calendar.current.dateComponents([.weekday, .hour, .minute], from: date)
  ...
  reminder.dateComponents = components
  </code></pre>
  <p>I have an array <code>selectedDays[Int]</code> (as a property of reminder class) to hold info on days of week on which the notification should fire.</p>
  <p>How can I schedule notification on specific day of week and how to repeat it weekly?</p>
  <p>Even a single comment will be helpful, and thank you in advance.</p>