title: Daily Local Notification In Swift iOS 9.2
body: <p>Trying to send a daily local notification in swift. However it just sends every minute for some reason. I want the first notification to send 30 mins after the app is opened and then repeat this notification everyday.</p>
  
  <p>in the swift fie i have the following code: </p>
  
  <p>//---------Daily notification code (also add section in app delagate----------
          let theDate = NSDate()</p>
  
  <pre><code>    let dateComp = NSDateComponents()
      dateComp.minute = 30
  
      let cal = NSCalendar.currentCalendar()
  
      let fireDate:NSDate = cal.dateByAddingComponents(dateComp , toDate: theDate, options: NSCalendarOptions(rawValue: 0))!
  
  
      let notification:UILocalNotification = UILocalNotification()
  
      //choosing what it says in the notification and when it fires
      notification.alertBody = "Your Daily Motivation is Awaits"
  
      notification.fireDate = fireDate
  
  
      UIApplication.sharedApplication().scheduleLocalNotification(notification)
  
      //displaying notification every day
      notification.repeatInterval = NSCalendarUnit.Day
  
  
  
      //-------------end of daily notification code---------------
  </code></pre>
  
  <p>in my app delegate file i have the following code:</p>
  
  <pre><code>func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -&gt; Bool {
  
      //----------daily notification section ----------
      let notiftypes:UIUserNotificationType = UIUserNotificationType.Alert.union(UIUserNotificationType.Badge).union(UIUserNotificationType.Sound)
  
      let notifSettings:UIUserNotificationSettings = UIUserNotificationSettings(forTypes: notiftypes, categories: nil)
  
      UIApplication.sharedApplication().registerUserNotificationSettings(notifSettings)
  
      return true
      //----------end of daily notification section-----------
  }
  </code></pre>