title: UITableView reloadData looping
body: <p>In my app, I'm updating a <code>UITableView</code> based on the user's location. I'm doing this inside the <code>CLLocationManagerDelegate</code>. Now, what happens is that my <code>UITableView</code> will keep reloading and thus not drawing anything. When I comment out the <code>reloadData()</code> call, all is fine (without the location ofcourse). When I add it back in, the <code>print()</code> is executed once. After that the table keeps reloading.</p>
  
  <pre><code>extension RestaurantsViewController: CLLocationManagerDelegate {
      func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
          if (locations.count &gt; 0) {
              if (location?.coordinate.longitude != locations[0].coordinate.longitude &amp;&amp; location?.coordinate.latitude != locations[0].coordinate.latitude) {
                  location = locations[0]
                  print("will reload table")
                  self.tableView.reloadData()
              }
          }
      }
  }
  </code></pre>
  
  <p>Any ideas how I can fix this?</p>