【问题标题】:ios - How to extend location tracking time using Swift 4 [duplicate]ios - 如何使用 Swift 4 延长位置跟踪时间 [重复]
【发布时间】:2018-09-11 04:15:50
【问题描述】:

我正在使用 swift 4 进行 IOS 位置跟踪。我看到方法 didUpdateLocations 每秒执行一次

如果有办法将时间从 1 秒增加到 n 秒,请告诉我。我认为它可以减少应用程序的电池消耗问题。

提前谢谢你!

【问题讨论】:

标签: ios swift core-location


【解决方案1】:

这行代码解决了我的问题。它会每 100 米通知 LocationManager

locationManager.distanceFilter = 100.0;

谢谢:How to stop multiple times method calling of didUpdateLocations() in ios

【讨论】:

    猜你喜欢
    • 2013-12-04
    • 1970-01-01
    • 1970-01-01
    • 2016-11-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多