测试已测试 | ✗ |
语言语言 | SwiftSwift |
许可协议 | MIT |
发布最后发布 | 2017年5月 |
SwiftSwift版本 | 3.1 |
SPM支持SPM | ✗ |
由 Roman Barzyczak 维护。
SwiftBackground 是您在应用终止或被杀死时与 Location Manager 轻松高效工作的正确选择。它基于区域监控。演示如何工作(蓝色为正常跟踪,红色线为基于区域的跟踪)
要运行示例项目,克隆仓库,然后首先从 Example 目录运行 pod install
只需在您的应用代理中添加
var backgroundLocationManager = BackgroundLocationManager()
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
backgroundLocationManager.startBackground() { result in
if case let .Success(location) = result {
LocationLogger().writeLocationToFile(location: location)
}
}
return true
}
SwiftBackgroundLocation 通过 CocoaPods 提供。要安装,只需将以下行添加到您的 Podfile
pod "SwiftBackgroundLocation"
yoman07, [email protected]
SwiftBackgroundLocation 在 MIT 许可协议下可用。有关更多信息,请参阅 LICENSE 文件。