core-location

Core Location in iPhone Simulator 3.2 (iPad)

核能气质少年 提交于 2019-12-18 05:03:49
问题 So, i'm trying to port my app to iPad. I'm using CoreLocation. Apple says the iPad does have Location: Wi-Fi Digital compass Assisted GPS (Wi-Fi + 3G model) Cellular (Wi-Fi + 3G model) so it should be possible to get the position of my ipad (at least with 3g model) about 3km radius would be enought. but it doesnt work in simulator (3.2 ipad) (running 3.1.3 in simulator simulates me cupertino). is there a way to get the position in simulator (3.2 ipad) ? i live in germany and here the ipad

Core Location in iPhone Simulator 3.2 (iPad)

痞子三分冷 提交于 2019-12-18 05:02:26
问题 So, i'm trying to port my app to iPad. I'm using CoreLocation. Apple says the iPad does have Location: Wi-Fi Digital compass Assisted GPS (Wi-Fi + 3G model) Cellular (Wi-Fi + 3G model) so it should be possible to get the position of my ipad (at least with 3g model) about 3km radius would be enought. but it doesnt work in simulator (3.2 ipad) (running 3.1.3 in simulator simulates me cupertino). is there a way to get the position in simulator (3.2 ipad) ? i live in germany and here the ipad

Number of “region” monitored by RegionMonitoring, based on users current location in iOS7

断了今生、忘了曾经 提交于 2019-12-18 03:43:08
问题 I am working on such a project where apps do the following things: User select a radius (10 meter to 1000 meter) and go to next viewController by pressing "Go" button Here apps Grab users current position and start "region monitoring" based on that current position with selected radius If the user cross that certain boundary (10 meter to 1000 meter) then it gives an "ExitRegion" alert message. And start "region monitoring" again based on users new current position. And the apps keep doing

Open Maps app from Code - Where/How to find the “Current Location”?

*爱你&永不变心* 提交于 2019-12-18 01:11:07
问题 I am opening Maps app to show directions from user's Current Location to a destination coordinate, from my code. I am using the following code to open the Maps app. I am calling this code when a button is pressed. getCurrentLocation is a method that returns the recently updated location. - (void)showDirectionsToHere { CLLocationCoordinate2D currentLocation = [self getCurrentLocation]; // LINE 1 NSString* url = [NSString stringWithFormat: @"http://maps.google.com/maps?saddr=%f,%f&daddr=%f,%f",

How to track user location in background?

孤街浪徒 提交于 2019-12-17 23:29:34
问题 I'm looking for an open source app or library to track user location in the background. Now I'm trying to do it with CLLocation and background tasks, but accuracy is not enough for my case. Could you explain, how apps, like "moves", "runkeeper", "endmondo", creates my route? Should I use Accelerometer or/and compass to create a route between CLLocation background points? Some code: //location manager init self.locationManager = [[CLLocationManager alloc] init]; self.locationManager

Find city name and country from latitude and longitude in Swift

不打扰是莪最后的温柔 提交于 2019-12-17 21:51:51
问题 I'm working on application in Swift3 and I have letter problem i can't find the answer for it. How can I know city name and country short names base on latitude and longitude? import UIKit import CoreLocation class ViewController: UIViewController, CLLocationManagerDelegate{ let locationManager = CLLocationManager() var latitude: Double = 0 var longitude: Double = 0 override func viewDidLoad() { super.viewDidLoad() // For use when the app is open & in the background locationManager

How can I tell if an iOS device has a GPS?

霸气de小男生 提交于 2019-12-17 19:35:20
问题 For an iPad, or iPod touch, is there a way to find out if the device has GPS? Extra Credit: What if the iPad itself does not, but it is connected to a third-party GPS unit? Can I determine this? 回答1: For iOS 6 or higher, you might want to try + (BOOL)[CLLocationManager deferredLocationUpdatesAvailable] According to the documentation: Deferred location updates require the presence of GPS hardware and may not be supported on all iOS devices. 回答2: Apple does not provide a function to directly

Search for all iBeacons and not just with specific UUID

ぐ巨炮叔叔 提交于 2019-12-17 17:29:26
问题 Is it possible to search for all iBeacons which are nearby? I know it's possible to search iBeacons by UUID. But i want to find all iBeacons nearby. 回答1: An iBeacon is a region, and has as defining property the UUID. Therefore, you can only search for the ones matching a UUID. After you find one or more with a specific UUID, you can figure out which is closest using the delegate callbacks, where the beacons are stored in an array ordered by distance. There is great sample code on this and

MapKit in Swift, Part 2

人走茶凉 提交于 2019-12-17 17:00:17
问题 I'm trying work with Map Kit in Swift. I try to display the area on the map, one pin (MKPinAnnotationView) and the current position. All display fine. I try to add Disclosure Button and intercept tapping on it. Disclosure Button added, but does not work intercept tapping. Function pinPressed with method calloutAccessoryControlTapped not work.... This is a sample code: import UIKit import MapKit import CoreLocation class ViewController: UIViewController, MKMapViewDelegate,

Run a Swift 2.0 app forever in background to update location to server

北城余情 提交于 2019-12-17 15:38:35
问题 I have written the below code that has a timer that calls a callback function every minute. When the app goes to the background I have started another timer that calls the same callback method, but the background timer works for only three minutes. I understand that Apple allows background tasks for only three minutes. My app is more like a tracking app that tracks the location of the user every minute even when the app is in background, so I need to implement this functionality. I learned