title: Background Task works on Simulator only
body: <h3>Background</h3>
  
  <p>I have created a sample timer app that counts from a specific value down to zero. A label displays how much time is left.</p>
  
  <p>Every time the <code>NSTimer</code> (1s interval) calls <code>countDownSecs()</code> it prints how many seconds are left and executes <code>println("countDownSecs()")</code>. When the countdown has reached <code>0</code> seconds it sends a local push notification. <br>
  When running in the <strong>simulator</strong> that <strong>works</strong> and even for like 5 minutes it stays in the background and continuously prints the seconds left and <code>countDownSecs()</code>. <br>
  On the other hand, when running on an actual device (iPhone 4S, iOS 8.1.3 and iOS 8.3) it stops immediately when entering the background. (It worked before on the one w/ iOS 8.3. I thought it might be because the iPhone 4S can not handle that but the iPhone 4S simulator works perfectly fine.)</p>
  
  <h3>Code</h3>
  
  <p>In the <code>AppDelegate</code>'s <code>applicationDidEnterBackground()</code> I have the following code for the <code>UILocalNotification</code>:</p>
  
  <pre><code>var alarmTime: NSDate = NSDate()
  var app: UIApplication = UIApplication.sharedApplication()
  var notifyAlarm: UILocalNotification = UILocalNotification()
  
  //counterAll contains the total amount of seconds        
  alarmTime.dateByAddingTimeInterval(NSDate.timeIntervalSinceReferenceDate())
  notifyAlarm.fireDate = NSDate(timeIntervalSinceNow: counterAll)
  notifyAlarm.timeZone = NSTimeZone.defaultTimeZone()
  notifyAlarm.repeatInterval = NSCalendarUnit(0)
  notifyAlarm.soundName = "Time's Up.m4a"
  notifyAlarm.alertBody = "Time's Up! - Your timer has ended."
  app.scheduleLocalNotification(notifyAlarm)
  </code></pre>
  
  <h3>Question</h3>
  
  <p>Can I change anything to fix this issue?</p>
  
  <p>Thanks in advance :)</p>