【发布时间】:2018-04-07 18:10:47
【问题描述】:
我已经构建了一个 Swift 库,它使用 CoreLocation 在应用程序正在使用时获取用户位置。如果我想将我的库集成到应用程序中,我只需要导入库,实例化我的类并启动获取用户位置的方法......
...而且我还需要在应用 Info.plist 中添加NSLocationWhenInUseUsageDescription!
我想知道是否可以在库 Info.plist 中添加 NSLocationWhenInUseUsageDescription 以让程序员选择是实现自定义描述还是保留默认库描述。
附:我已经在 Info.plist 库中添加了 NSLocationWhenInUseUsageDescription,但是如果我决定不在应用程序 Info.plist 中添加它,Xcode 会不高兴:
This app has attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSLocationWhenInUseUsageDescription key with a string value explaining to the user how the app uses this data
提前非常感谢!
【问题讨论】:
标签: ios swift xcode core-location