I try to set the location manager's pausesLocationUpdatesAutomatically to true in Swift but it seems to have no result.
Also, according to the documentation:
The default value of this property is true.
However, the default value in reality seems to be false and also there seems to be no way of setting it to true:
let manager = CLLocationManager()
println(manager.pausesLocationUpdatesAutomatically) // prints false
manager.pausesLocationUpdatesAutomatically = true
println(manager.pausesLocationUpdatesAutomatically) // prints false
How to set this property to true?
If you're running it in the simulator, it will always show "false".
Try running it on the device, like I just did, it will always say "true".
NOTE: This is applicable to iOS7-iOS11, and Objective-C as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With