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
0
votes
1 answer

How should CLLocationManager status be checked in locationManagerDidChangeAuthorization before loading an iOS view?

Since iOS 16/Xcode 14, I get this error: This method can cause UI unresponsiveness if invoked on the main thread. Instead, consider waiting for the -locationManagerDidChangeAuthorization: callback and checking authorizationStatus first."? I am…
florida27
  • 67
  • 1
  • 7
0
votes
2 answers

CLLocationManager run loop

I''m getting an infinite loop with the below code. When a user hits the "getDirections" method button, the alert fires correctly. When the choose "Get Drections" from alert buttons, google maps works perfectly. When they re-open the app, it opens…
Eric
  • 4,063
  • 2
  • 27
  • 49
0
votes
0 answers

iOS Mapkit Annotation Pin Shrinking

MapView is pin skrinking everytime. I'm using MKAnnotationView. Can anyone tell what what am I missing here why the pin shrinking? I want to show the pin like that star icon which is also annotation. Also everytime I change the current location…
0
votes
3 answers

Confirm user's selection of "Don't Allow" location services

I am using location services in my app. Initially the app asks the user to allow finding the current location. If the user says "Don't Allow", can I show one more alert to confirm that choice? Then, if the user says "Allow" in that second dialogue,…
Swapnil
  • 1,858
  • 2
  • 22
  • 49
0
votes
1 answer

calling coordinates from Core Data

i've been trying to call the latitude and longitude of places that i have stored into the database. I've set the storage type as double. At the the first view controller, i tried to push the coordinates, and in the log it works fine. -(IBAction)…
Harvin
  • 179
  • 2
  • 12
0
votes
2 answers

CLLocationManager weird issues

I have a MKMapView whereby I drop an annotation everytime the view loads, or when showLocation custom class method is called. I need the accuracy to be the best -(void)viewDidLoad { locationManager = [[CLLocationManager alloc] init]; …
Gavin
  • 2,784
  • 6
  • 41
  • 78
0
votes
1 answer

Catch every moment when user change his location

I am using Google Map SDK. I want to catch every moment when user changes his location, maybe from CLLocationManagerDelegate. Can anyone say which method can execute previous job? I tried to use func locationManager( _ manager: CLLocationManager,…
Rezo Joglidze
  • 321
  • 1
  • 3
  • 15
0
votes
0 answers

How can there be duplicate method declarations in CLLocationManagerDelegate for locationManager?

I am new to Swift and working through an online iOS development bootcamp course and the course has introduced the delegate design pattern. The course earlier demonstrated the design pattern via the use of the UITextFieldDelegate and is now…
0
votes
1 answer

Swift, ClLocationManager slow to fire didEnterRegion

I am trying to implement directions with clLocationManager in a project. Everything is working ok, but the didEnterrRegion function is very slow to fire. When testing, I enter the region but only 2-3 minutes after exiting the region I get the…
0
votes
1 answer

locationManager.startUpdatingLocation gets executed too late

I am trying to get my user's current location using a closure, but it returns a nil value because the locationManager.startUpdatingLocation() sets the value after the closure has returned the (nil) value. I don't know how to wait for the value to…
Maria
  • 31
  • 3
0
votes
2 answers

iOS CLLocationManager - do the region monitor manually

Although i know that the region monitoring supports iPhone4 and iPad2 only i want to implement this with the startMonitoringSignificantLocationChanges method. I have a method that get my saved region (place with latitude, longitude and radius) and…
Elad
  • 479
  • 3
  • 11
  • 21
0
votes
0 answers

Best Practice way to handle locationAlways permission request in iOS

How are we supposed to handle, when a user denies the permission request for kCLAuthorizationStatusAuthorizedAlways ? As i understand it, we don't get a direct response to requestAlwaysAuthorization, but rather we have to register a callback for…
0
votes
2 answers

Background location updates for iOS display GPS icon the entire time

My app runs significant location change updates in the background. However the GPS display icon never turns off..even when app is in the background. Is there a way to use location manager with Significant location change in the background and have…
0
votes
1 answer

Google Maps iOS SDK to user's current location on launch Swift SwiftUI

I'm trying to mimic some functionality of Google Maps, where upon launching the app, the camera is moved to the current location of the user, provided the required perms have been granted. I have implemented this using a custom current location…
Angus
  • 133
  • 1
  • 8
0
votes
1 answer

"Invalid initializer" error when compiling

I use this code - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. [self.window makeKeyAndVisible]; //…
iRam11
  • 309
  • 4
  • 16
1 2 3
99
100