title: iOS find average speed
body: <p>I already have something that shows me my current speed and top speed (max speed in the code below) Now I want to make something that calculates my average speed with core location. How? thanks. </p>
  
  <pre><code>- (void)locationUpdate:(CLLocation *)location {
  speedLabel.text = [NSString stringWithFormat:@"%.2f", [location speed]*2.236936284];
  </code></pre>
  
  <p>Here is the float for top speed</p>
  
  <pre><code>   float currentSpeed = [location speed]*2.236936284;
  if(currentSpeed - maxSpeed &gt;= 0.01){
      maxSpeed = currentSpeed;
      maxspeedlabel.text = [NSString stringWithFormat: @"%.2f", maxSpeed];
  
  }
  </code></pre>