Questions tagged [cllocationmanager]

The CLLocationManager class defines the interface for configuring the delivery of location- and heading-related events to your application

The CLLocationManager class defines the interface for configuring the delivery of location- and heading-related events to your application. You use an instance of this class to establish the parameters that determine when location and heading events should be delivered and to start and stop the actual delivery of those events. You can also use a location manager object to retrieve the most recent location and heading data.

A location manager object provides support for the following location-related activities:

  • Tracking large or small changes in the user’s current location with a configurable degree of accuracy.
  • Reporting heading changes from the onboard compass. (iOS only)
  • Monitoring distinct regions of interest and generating location events when the user enters or leaves those regions.
  • Deferring the delivery of location updates while the app is in the background. (iOS 6 and later only)
2729 questions
17
votes
5 answers

What does horizontalAccuracy exactly mean?

I am working on an iOS application using location services. Having a background in experimental physics, I am wondering what exactly horizontalAccuracy in a location found in locationManager:didUpdateToLocation:fromLocation: stands for. The…
Axel
  • 1,716
  • 1
  • 16
  • 28
16
votes
2 answers

Having trouble calculating accurate total walking/running distance using CLLocationManager

I'm trying to build an iOS app that displays the total distance travelled when running or walking. I've read and re-read all the documentation I can find, but I'm having trouble coming up with something that gives me an accurate total…
Daniel
  • 1,151
  • 1
  • 9
  • 15
16
votes
2 answers

CLLocation ask again for permission

Currently my application asks only once for permission to use the current location. If the user doesn't allow, he isn't ask again unless he resets location warning in the general settings. I would like to give the user a chance from within the app…
Reinhold
  • 234
  • 2
  • 10
16
votes
6 answers

CLLocationManager authorization issue iOS 8

I am working on a piece of Swift code for iOS 8. I am trying to do something which involves location, and so i have implemented the following in my swift view controller file: let locationManger:CLLocationManager = CLLocationManager() var…
brisi123
  • 163
  • 1
  • 1
  • 5
14
votes
4 answers

Does CLLocationManager work without internet/cellular connection?

Silly question !! Though I want to know that is it possible that CLLocationManager works without Internet ????? i.e. iPhone is not connected to internet at all
Janak Nirmal
  • 22,706
  • 18
  • 63
  • 99
14
votes
4 answers

How to rotate a Direction Arrow to particular location

In my app I have a latitude-longitude of 1 fix location. Now user with iPhone device can move anywhere and even he rotate his device, the arrow (some uiimageview) should point to that fix location so User will get direction to that location every…
14
votes
2 answers

Error when running Xcode simulator - '[framework] CUIThemeStore: No theme registered with id=0'

I am developing an app with a single view and some labels. The app fails at the viewdidload() func and does not proceed further. The code is listed below. override func viewDidLoad() { super.viewDidLoad() locationManager.delegate = self …
spenumatsa
  • 141
  • 1
  • 1
  • 7
14
votes
2 answers

Reverse geocoding in Swift 4

I'm attempting to write a simple method that's fed CLLocationDegrees and returns a CLPlacemark. Looking at Apple's documentation, it seems like a simple task. Below is what I've dumped into a playground: import CoreLocation // this is necessary for…
Adrian
  • 16,233
  • 18
  • 112
  • 180
14
votes
4 answers

CLLocationManager is slow getting location, Swift

Im creating this app, and it needs to get the users location - its all working properly, the thing is, that the time from accepting the use of location services, to getting the actual location takes like 5 seconds - is this normal? I've used other…
Nicolai Harbo
  • 1,064
  • 12
  • 25
14
votes
5 answers

Why the CLLocationManager delegate is not getting called in iPhone SDK 4.0?

This is the code that I have in my AppDelegate Class - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { CLLocationManager *locationManager = [[CLLocationManager alloc] init]; …
Biranchi
  • 16,120
  • 23
  • 124
  • 161
14
votes
7 answers

How to get Location user with CLLocationManager in swift?

I have this code on my view controller but this not working: import UIKit import CoreLocation class ViewController: UIViewController, CLLocationManagerDelegate { var location: CLLocationManager! override func viewDidLoad() { …
user3745888
  • 6,143
  • 15
  • 48
  • 97
14
votes
3 answers

Apple rejection because UIBackgroundMode = location

I submitted an app which tracks the user's location (and sends it to the server) at some fixed intervals chosen by the user (5 min, 10 min, 30 min, 1 h). The app should work in background, too (sending the requests) and I have declared it as…
Alexandru Circus
  • 5,478
  • 7
  • 52
  • 89
13
votes
3 answers

CLLocationManager responsiveness

I have an app that revolves around the device's GPS and the information that comes from it. It is important that the location data be accurate and up-to-date. I know that the device is limited by its GPS and the GPS's limits, but I was wondering if…
eric.mitchell
  • 8,817
  • 12
  • 54
  • 92
13
votes
6 answers

Pretty Print Distances for iOS

I have two CLLocation objects and I would like the show the distance between them in a nice and pretty format. Like "22 feet", "58 yards", or "2.3 miles" CLLocation *location1 = [[CLLocation alloc] initWithLatitude:42.333297…
coudron
  • 317
  • 2
  • 10
13
votes
4 answers

CLLocationmanager "locationServicesEnabled" method deprecated in iOS 4?

I know the property locationServicesEnabled is deprecated in iOS 4. Instead, I should call locationServicesEnabled In my app delegate method -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary…
Jing
  • 1,935
  • 3
  • 17
  • 26