title: How to check if user's current location is inside a location circle
body: <p>i want to check if user if inside a vicinity. For example i have specified a radius of 50 meters around current of location of user. Let's say if user is moving, now i want to check if user in inside 50 meter radius or not. Here is my code </p>
  
  <pre><code> override func viewDidLoad() {
          super.viewDidLoad()
  
            locationManager.startMonitoringVisits()
            locationManager.delegate = self
            locationManager.distanceFilter = 1
            locationManager.allowsBackgroundLocationUpdates = true
            locationManager.startUpdatingLocation() 
      }
  
  
  </code></pre>
  
  <p>Here is code for checking distance</p>
  
  <pre><code>
      func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
  
          guard let location = locations.first else {
              return
          }
          let officeLocation = CLLocationCoordinate2D.init(latitude: 31.471303736482234, longitude: 74.27275174139386)
  
          let circle = MKCircle(center: officeLocation, radius: 50 as CLLocationDistance)
          if location.distance(from: officeLocation) &gt; circle.radius {
              self.newVisitReceived(des: "YOU ARE OUT OF OFFICE")
          }
          else{ 
              self.newVisitReceived(des: "YOU ARE IN OFFICE")
           }
  
      }
  </code></pre>
  
  <p>Even if i don't move this code sends notification "YOU ARE OUT".</p>