I’m working in a performance to get the space between the present location of a consumer and the situation of a store, if the space is bigger than a selected vary I want to point out some alerts.
To get the coordinates of the store places I’m passing the deal with of store, my concern is will the coordinates might be correct whereas passing the deal with, although the town, pincode and so forth just isn’t handed.
If the coordinates won’t be correct, please counsel another method to get the coordinates.
code I used to get the coordinates of store:
var geocoder = CLGeocoder()
geocoder.geocodeAddressString("store deal with") { placemarks, error in
let placemark = placemarks?.first
let latitude = placemark?.location?.coordinate.latitude
let longitude = placemark?.location?.coordinate.longitude
}