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
6
votes
2 answers

How to use CLLocation extension in RxSwift

I want to use CLLocationManager with RxSwift like in https://github.com/ReactiveX/RxSwift/issues/413 but I found that CLLocationManager extension was moved to RxExample (mentioned here https://github.com/ReactiveX/RxSwift/issues/900). My question…
krlbsk
  • 1,051
  • 1
  • 13
  • 24
6
votes
2 answers

What is difference between startMonitoringSignificantLocationChanges() and startUpdatingLocation() method of CLLocationManager?

I'm working with CLLocationManager class. I want to get location updates periodically. I had found two methods to get location in didUpdateLocations method, that are startUpdatingLocation() and startMonitoringSignificantLocationChanges(). If I have…
Bhawna Raheja
  • 619
  • 4
  • 11
6
votes
1 answer

CLGeocoder reverse geocoding fails with Error Domain=NSURLErrorDomain Code=-1000 -

With a CLLocation object (content e.g. latitude = 48.196169, longitude = 11.620237), I try to get the current city and country like: if(!geocoder) { geocoder = [[CLGeocoder alloc] init]; } if (geocoder.geocoding) [geocoder cancelGeocode]; …
Adrian
  • 524
  • 5
  • 21
6
votes
1 answer

How to remove cache of cllocation?

I am developing an iPhone app which is a location aware app . Currentlly the app is working fine except the caching of previous location . The first time I start the application location manager fetches the current location and then I display…
harshalb
  • 6,012
  • 13
  • 56
  • 92
6
votes
3 answers

iPhone 3.0 Compass: how to get a heading?

I'm relatively new to Objective-C and really don't know much about it yet, so I apologise for what is probably a really amateurish question. I'm trying to get the magnetic heading from CLHeading and CLLocationDirection. However I'm getting compile…
Sean R
  • 1,519
  • 2
  • 13
  • 16
5
votes
2 answers

Location manager giving old locations with new timestamps

I'm having the following problem in my iPhone app: I enable the location manager on a regular basis and I do wait for multiple location updates. When receiving a new location, I check the timestamp property of the new location to know whether it's…
wjans
  • 10,009
  • 5
  • 32
  • 43
5
votes
1 answer

How to show compass on Screen?

I am new to iOS development. My objective is to show a compass on Screen. I have a latitude and longitude of a certain location. I have gotten my current latitude and longitude by using CLLocation. I have calculated the distance between two points…
Rohit Singhal
  • 381
  • 1
  • 4
  • 22
5
votes
1 answer

converting a CLLocationCoordinate2D type to number or string

I was wondering how to convert latitude and longitude values of CLLocationCoordinate2D to numbers or string values. Iver tried a few different ways but they arene't working: CLLocationCoordinate2D centerCoord; centerCoord.latitude =…
banditKing
  • 9,405
  • 28
  • 100
  • 157
5
votes
1 answer

Order of CLLocation objects in -distanceFromLocation:

This is my first time posting a question here, but I have found a lot of help from other people's questions. My question refers to the -distanceFromLocation: function in CLLocation. I had assumed that finding the distance between point A and point B…
Greg
  • 51
  • 1
5
votes
3 answers

How does CLLocation implement the Equatable protocol?

In answering another question on SO, I found that the CLLocation class conforms to the Equatable protocol. What method does it use to determine equality? Exact match of lat/long? Exact match of lat/long and altitude? Exact match of latitude,…
Duncan C
  • 128,072
  • 22
  • 173
  • 272
5
votes
3 answers

iOS Location Accuracy

Hello i am using location in iOS app i set the accuracy like this: locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters and i am using this function to check the accuracy func locationManager(manager: CLLocationManager,…
Panayiotis Irakleous
  • 2,696
  • 1
  • 23
  • 36
5
votes
2 answers

Sort a list by distance using reversed Geolocation

I'm using Xcode 7 with iOS9. I want to sort a list ascending, based on distance from users current location to all other locations in the list. I don't want to calculate the distance to a location by coordinates, but by address because the…
5
votes
1 answer

requestLocation() always fails in the simulator with Swift 2

Swift 2 and watchOS2 has completely changed how Apple Watch extensions work and I have to now recreate them. Originally, I had requested the location on the watch in the normal fashion: self.locationManager.delegate = self …
MantisShrimp
  • 171
  • 2
  • 12
5
votes
0 answers

iBeacon ranging in foreground with static library

I have created a framework that takes care of registering CLBeaconRegions and, when in range, ranging the CLBeacons and then send a UILocalNotification. It works as it should when I compile an app with the actual classes, but not when I compile an…
Mathijs
  • 1,258
  • 1
  • 10
  • 27
5
votes
1 answer

CLLocationManager, how to get full name of city or State

i am using CLLocationManager class in my iPad App to get current location. i am using below code to get Address details, - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation…
user2813740
  • 517
  • 1
  • 7
  • 29