Questions tagged [cllocation]

A CLLocation object represents the location data generated by a CLLocationManager object. This object incorporates the geographical coordinates and altitude of the device’s location along with values indicating the accuracy of the measurements and when those measurements were made. In iOS, this class also reports information about the speed and heading in which the device is moving.

A CLLocation object represents the location data generated by a CLLocationManager object. This object incorporates the geographical coordinates and altitude of the device’s location along with values indicating the accuracy of the measurements and when those measurements were made. In iOS, this class also reports information about the speed and heading in which the device is moving.

Typically, you use a CLLocationManager object to create instances of this class based on the last known location of the user’s device. You can create instances yourself, however, if you want to cache custom location data or get the distance between two points.

This class is designed to be used as is and should not be subclassed.

https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLLocation_Class/CLLocation/CLLocation.html#//apple_ref/doc/uid/TP40007126

810 questions
-2
votes
2 answers

How to calculate CLLocation distance between 2 CLLocation points using as a path an array of CLLocations and not a straight line

I have 2 CLLocation coordinates and I wanna know the distance between them using as a path an array of coordinates that go from point A to B. I know how to calculate the distance from point A to B but the problem is that it seems to be measured in a…
Oxi Ros
  • 11
  • 3
-2
votes
1 answer

Cant open location services screen

please someone help me. How can I open Location Services from my app? I tried this but it doesn't work URL(string: "prefs:root=LOCATION_SERVICES")
lucca910
  • 91
  • 1
  • 9
-2
votes
1 answer

couldn't call the user defined method in objective c

I am using core location framework. I am checking Authorization status (kCLAuthorizationStatusDenied/kCLAuthorizationStatusRestricted) in user-defined method. The noticeable point is this method is being called in case of the normal flow of…
-2
votes
1 answer

Unwrapping optional for MKMap Location gives error

I'm trying to include a map in my application - following the instructions here. The problem is that I'm getting an error when setting the region - the line of code "let region = MKMap..." and I don't know why. Has anyone encountered this problem or…
user282041
  • 37
  • 8
-2
votes
1 answer

Setting a value in a function as a variable outside the function (Swift)

I want to grab newRecordLat and newRecordLong and save them as a variable outside the function. The purpose is because I want to store these variables in a database. They are currently outputting in CLLocationDegrees, not a string, int, float, or…
Josh O'Connor
  • 4,694
  • 7
  • 54
  • 98
-2
votes
2 answers

How to use NSDecimalNumber to convert latitude and longitude in IOS

I would like to show my position on the map, I'm using CLLocation for doing it Here is my code: CLLocationCoordinate2D coordinate; coordinate.latitude = latitude; coordinate.longitude = longitude; With latitude and longitude is float type and get…
-2
votes
2 answers

CLLocationManager updates only on Simulator Not on Devices

Here we have to update the current location by using the location manager,and its correctly updating on simulator but its not updating on device only 4 or 5 times only repeated.why the location is not updated frequently kindly hep me to solve this…
dineshprasanna
  • 1,284
  • 4
  • 20
  • 37
-3
votes
1 answer

How to get accurate current location coordinates (latitude/longititude) in IOS Swift

I am using CoreLocation in IOS Swift to get the current coordinates but for some cases, it gives me closest to my desired location while sometimes the coordinates are many meters away from my given address. please check my code which I am using is…
-3
votes
1 answer

iOS - How - startMonitoringSignificantLocationChanges works

How the iOS system trigger the method -startMonitoringSignificantLocationChanges? Will the system trigger this automatically? What if I want every 500m trigger the -startMonitoringSignificantLocationChanges how can I set my locationManager?
Dean Lee
  • 781
  • 2
  • 7
  • 13
-3
votes
2 answers

How to get location for one time in ios

How to fetch the location for only one time in ios app.
ganka
  • 191
  • 1
  • 11
-3
votes
1 answer

CLLocation GeoFire Location Time

Does anyone knows how to print the time at the end of the Location? when printing out the full location in the following code: There is a time difference between the time in the result while printing out the Location and the time location?.timestamp…
Gael
  • 1
  • 4
-3
votes
2 answers

'CLLocation' is not convertible to 'CLLocationCoordinate2D'

I am trying to make use of multiple tutorials to teach myself Swift. So far I have this code. import UIKit import MapKit import CoreLocation class ViewController: UIViewController, CLLocationManagerDelegate, MKMapViewDelegate,…
metheone
  • 15
  • 3
-3
votes
1 answer

Why the same coordinate get a larger distance using distanceFromLocation

The code: CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake([[[NSUserDefaults standardUserDefaults] objectForKey:@"lat"] floatValue], [[[NSUserDefaults standardUserDefaults] objectForKey:@"lon"] floatValue]); CLLocation *currentLocation…
yong ho
  • 3,892
  • 9
  • 40
  • 81
-4
votes
1 answer

Trying to get distance calculated from gps detected location to a number of restaurants in a plist file

I have to do a project in which I have to calculate the distance from my location which is detected by gps to a number of restaurants whose locations are in a plist file and then display the distance in a list view as a subtitle of the restaurant…
-14
votes
3 answers

Difference between [CLLocation] and CLLocation

I am trying to find the distance between a location that I am grabbing from a user and a location that I hard coded, but I am getting a error can't convert [CLLocation] to CLLocation. func locationManager(_ manager: CLLocationManager,…
1 2 3
53
54