E
E
e-hot2017-06-19 22:06:49
iOS
e-hot, 2017-06-19 22:06:49

Why is CLLocationManager() ( swift ) in Xcode giving wrong coordinates?

Greetings. Need help in the following situation:
1. Situation: an iOS application written in Xcode on swift-e allows the site opened in UIWebView https:// to fix geo-coordinates, made from the docks from the Internet:
in info.plist I registered Location Always Usage Description and Location When In Use Usage Descprition
in ViewCOntroller.swift is written:
import CoreLocation

class ViewController: ... , CLLocationManagerDelegate {
...
let locationManager = CLLocationManager()
...

override func veiwDidLoad(){
...
locationManager.delegate = self
locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters
locationManager.startUpdatingLocation()
...
}

As a result, when checking the application on the simulator, I get in the site database (which opens in UIWebView ) the coordinates for some reason la = 37.785835 lo = -122.406418 - this is San Francisco, although I am physically located in Moscow (and the coordinates should be approximately 55,. ..... 37, ...... ).
2. Question: the coordinates do not correspond to my physical location because I did not specify some other necessary settings, or is it because the application is running in check mode on the simulator built into Xcode? I tried Debug->Simulate Location - the above coordinates are still fixed.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri Popov, 2017-06-20
@DjPhoeniX

The iOS Simulator has its own geolocation settings. Right here:
cdb19916bb3d448db29310ec1c99e02c.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question