---
title: "#7: CLVisit 🚘"
url: https://littlebitesofcocoa.com/7-clvisit
author: Jake Marsh
date: 2015-05-26
published: 2015-05-26
topics: ["Core Location"]
description: "Starting in iOS 8 you can retrieve the places users visit. CLVisit can and does deliver interesting results, but it’s not a slam-dunk yet."
---

# #7: CLVisit 🚘

By Jake Marsh, May 26, 2015. HTML: https://littlebitesofcocoa.com/7-clvisit

Starting in **iOS 8** you can retrieve the places users visit.

``` swift
class Chauffeur : CLLocationManagerDelegate {
  var manager: CLLocationManager

  func start() { manager.startMonitoringVisits() }
  func stop() { manager.stopMonitoringVisits() }

  // MARK: - CLLocationManagerDelegate

  func locationManager(manager: CLLocationManager!, didVisit visit: CLVisit!) {
    if visit.departureDate.isEqualToDate(NSDate.distantFuture() as! NSDate) {
      // A visit has begun, but not yet ended. User must still be at the place.
    } else {
      // The visit is complete, user has left the place.
    }
  }
}
```

_CLVisit_ can and does deliver interesting results, but it’s not a slam-dunk yet. Best to use it for journaling-style features, or when it’s okay if it’s not always perfectly accurate. That being said, I tried it out, and was surprised how well it did.

Here's an example "day" it tracked:

<img src="https://media.littlebitesofcocoa.com/bite-assets/007-clvisit-tracked-visits@2x.png" style="max-width: 209px;" />

## CLVisit Pros & Cons

- 👍 Polite to battery life
- 👍 Couldn't be simpler
- 😭 Not very accurate
- 😭 Visit data often arrives late
