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

"Value of type '(CLLocationManager, [CLLocation]) -> ()' has no member 'delegate' " Error in swift with mapping

When trying to find the location of a user, I use CLLocationManager. Where I have this line: locationManager.delegate = self It returns this error: Value of type '(CLLocationManager, [CLLocation]) -> ()' has no member ‘delegate' Here is the…
Darrow Hartman
  • 4,142
  • 2
  • 17
  • 36
-1
votes
1 answer

What to create or properly use a singleton

I would like to share the coordinates instance and use it on the DiscoverDetailVc. I had 2 location manager instances on my app, after couple research and reading, find out that the best approach is to create a singleton that each VC will use. I…
Vangola
  • 128
  • 7
-1
votes
1 answer

Error when inserting coordinates into array in Swift

Cannot convert value of type '[Dictionary]' to expected argument type 'UnsafePointer' Is the error I'm getting when trying to insert coordinates into my array. Here is my code: var locations: [CLLocationCoordinate2D] = [] //Updating…
user11131456
-1
votes
1 answer

Is it possible to return a double from my locationManager function?

I want to be able to call the locationManager function inside each IBAction function. But I don't know how to deal with all of the locationManager parameters in a function call. How do I deal with all the parameters in a function call? I tried to do…
-1
votes
1 answer

CCLocation keeps returning nil. Using singleton

For some strange reason it will crash the first time I try to run the program but if I run it again while the simulator is still running it works fine. Here is a snippit of code that is giving the issue. class CityList : NSObject,…
Broque
  • 9
  • 3
-1
votes
1 answer

Place annotations on a Map based on distance (meters) and bearing from current location

I'm working on an App to layout a sailing race course based on the number of boats, target time, wind direction and wind strength. Currently, I store all variables on the device and Pin the race committee starting boat on the map. I found a lot of…
-1
votes
1 answer

See if the user is near a location? Swift 4

I would like to be-able to see if the user is in a 5 km radius of the other location in Swift 4. For example: User Location: 37.785834, -122.406417 Other Location: -117.564011, 48.302353 Thanks for anyone who helps!
Oscar
  • 404
  • 7
  • 19
-1
votes
1 answer

ClLocation Placemark doesn't return administrativeArea

Hey I have some coordinates ["37.7", "-122.4"] that I am trying to use to reverse geoCode. So I can get the city and state for a simple UI Label. However when I use CLLocation to get the state via the administrativeArea var/method that comes…
Ron Baker
  • 381
  • 6
  • 16
-1
votes
2 answers

IOS Swift I can't get my real location from my app. I alway get the Apple Inc address

I always see the Apple inc as my current location on the map in my application's simulator. Can you help me to fix that?
user8968538
-1
votes
1 answer

How to find the user's location in swift?

Hello I am developing an application for ios and one of it's functions has to find the user's current location. Here is my code: import UIKit import MapKit import CoreLocation import SwiftyJSON struct City { let name : String let location :…
Dakata
  • 1,227
  • 2
  • 14
  • 33
-1
votes
1 answer

CompletionHandler is not executed

Im trying to obtain the "locality" from Coordinates using CLGeocoder.reverseGeocodeLocation, but when the execution reach the completionHandler the code inside the bracket is completely skipped to self.currentPlace = (self.place?.locality)! + ", " +…
-1
votes
1 answer

My LocationManager settings are changing back to default when it reaches didUpdateLocations

So, first stack overflow question but a long time reader ;) My LocationManager settings are changing back to default when it reaches didUpdateLocations. I've set up an observer in viewDidLoad as well as some defaults like so. I'm also alloc…
-1
votes
2 answers

Value of distance between 2 CLLocation points does not appear on label text

I am trying to calculate the distance from the starting position I am (when i first start the app) to the current position and present it on a label (meters.text) but nothing appears on it.. Here is my code: import UIKit import CoreLocation class…
-1
votes
1 answer

How can I properly unwrap these CLPlacemarks in Swift 2.0?

I am converting my Swift 1.2 project into Swift 2.0, and the biggest error so far is that when using reverseGeocodeLocation(), my CLPlacemarks no longer work. Xcode attempts to unwrap them properly but gets stuck. Here is my code that worked in…
MantisShrimp
  • 171
  • 2
  • 12
-1
votes
1 answer

How to tell if Coordinate is in between two other coordinates

I have an array of CLLocations which represent the route user calculated. User has an option to add certain POIs to that route and I need to know the way to tell where exactly on the route that POI will be. What I came up with is next: I would go…
SteBra
  • 4,188
  • 6
  • 37
  • 68