title: Save location and upload location swift
body: <p>I have this problem with my application, guess i'm approaching this problem wrong. 
  For every ten seconds i wish to save my current location to the phone. 
  And every one minute i wish to upload the current location to a web server.</p>
  
  <p>How do i do this?
  This is my code so far.</p>
  
  <pre><code> self.locationManager.requestAlwaysAuthorization()
      self.locationManager.requestWhenInUseAuthorization()
      if CLLocationManager.locationServicesEnabled() {
          locationManager.delegate = self
          locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters
  
      }
  
  
  }
  func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]){
      let newLocation = locations.last! as CLLocation
      saveLocations.saveLocation(newLocation.coordinate.longitude, latitude: newLocation.coordinate.latitude)
  
  }
  override func didReceiveMemoryWarning() {
      super.didReceiveMemoryWarning()
      // Dispose of any resources that can be recreated.
  }
  @IBAction func startButtonClicked(sender: AnyObject) {
      if(startButton.titleLabel?.text == "STARTA") {
          tenSecTimer = NSTimer.scheduledTimerWithTimeInterval(10, target:self, selector: Selector("tenSecTimer:"), userInfo: nil, repeats: true)
          sixtySecTimer = NSTimer.scheduledTimerWithTimeInterval(60, target: self, selector: Selector("sixtySecondsTimer:"), userInfo: nil, repeats: true)
          locationManager.startUpdatingLocation()
          startButton.setTitle("STOPPA", forState: UIControlState.Normal)
          startButton.backgroundColor = UIColor.redColor()
      } else {
          tenSecTimer.invalidate()
          sixtySecTimer.invalidate()
          locationManager.stopUpdatingLocation()
          startButton.setTitle("STARTA", forState: UIControlState.Normal)
          startButton.backgroundColor = UIColor.greenColor()
      }
  }
  
  //One minute upload 
  func sixtySecondsTimer(timer : NSTimer){
      print("60SEK")
  }
  
  //10Second timer
  func tenSecTimer(timer : NSTimer) {
      print("10SEK")
  }
  </code></pre>