AWSLocations
这是一个位置插件的Swift库。
安装
CocoaPods
CocoaPods是Objective-C的依赖管理器,它自动化并简化了使用第三方库(如AWSPlacePicker
)的流程。
首先,将以下行添加到您的Podfile
pod 'AWSLocations'
其次,将AWSLocations
添加到您的项目中
pod install
重要
请确保您已经在info.plist文件中添加了位置隐私密钥,即
<key>NSLocationUsageDescription</key>
<string></string>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
用法
将库导入到你想要使用工具的视图控制器中
import AWSLocations
然后开始使用
AWSLocationsUtils.shared.trackLocationChanges { (loc) in
print(loc)
}
可以自定义设置
// Please make sure this need to be set in AppDelegate Before accessing AWSLocationsUtils.shared object
AWSLocationsUtils.distanceFilter = 25.0
AWSLocationsUtils.alwaysRequired = true
许可证
AWSLocations
在 [MIT 许可证] 条件下分发