title: Local notifcations using datepicker
body: <p>I am using localNotifications for my app.I have a datepicker from which a users picks date and time for the notifications and I also have 3 segmented controls(daily,weekly,monthly).I have done the coding for localnotification and its working.But the segmented control is not working and one more problem if a person chooses two times like one for(1 pm) and second for (2pm) and then the notifications are displaying in both time which i dont want.Below is the code</p>
  
  <p>In appdelegate.swift</p>
  
  <pre><code>    let types:UIUserNotificationType = UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound
  
      let myAlarmSetting:UIUserNotificationSettings = UIUserNotificationSettings(forTypes: types, categories: categories as Set&lt;NSObject&gt;)
  
      UIApplication.sharedApplication().registerUserNotificationSettings(myAlarmSetting)
  </code></pre>
  
  <p>In notifications.swift</p>
  
  <pre><code>@IBAction func NotificationButtonTapped(sender: AnyObject) {
  
      func cancelLocalNotificationsWithUUID(uuid: String) {
  for item in UIApplication.sharedApplication().scheduledLocalNotifications {
      let notification = item as! UILocalNotification
      if let notificationUUID = notification.userInfo?["UUID"] as? String {
          if notificationUUID == uuid {
              UIApplication.sharedApplication().cancelLocalNotification(notification)
          }    
      }
      }
      }
  
  
      var notifications:UILocalNotification = UILocalNotification()
      notifications.fireDate = datePicker.date
      notifications.timeZone = NSTimeZone.defaultTimeZone()
      notifications.applicationIconBadgeNumber = UIApplication.sharedApplication().applicationIconBadgeNumber + 1
      notifications.soundName = UILocalNotificationDefaultSoundName
   notifications.userInfo = ["UUID": "YOUR NOTIFICATION ID"]
      switch(frequencysegmentedcontrol.selectedSegmentIndex){
      case 0:
          notifications.repeatInterval = NSCalendarUnit.CalendarUnitDay
          break;
      case 1:
          notifications.repeatInterval = NSCalendarUnit.CalendarUnitWeekOfYear
          break;
      case 2:
          notifications.repeatInterval = NSCalendarUnit.CalendarUnitYear
          break;
      default:
          notifications.repeatInterval = NSCalendarUnit(0)
          break;
      }
      notifications.alertBody = "quote of the day"
      notifications.category = "First_category"
  
      UIApplication.sharedApplication().scheduleLocalNotification(notifications)
  }
  
  func application(application: UIApplication, didReceiveLocalNotification notification: UILocalNotification) {
      application.applicationIconBadgeNumber = 0
  }
  </code></pre>