是否可以在iPad上的Swift操场上使用HealthKit?
我正在尝试将正在iPad上开发的Swift Playgrounds应用程序连接到Apple Watch。在Swift文件中导入HealthKit并访问其类和方法非常有效,但是在运行时,我会发现一个错误,说NshealthupdateUsagedescription键应在info.plist文件中设置。问题在于iPad Swift Playgrounds应用程序没有任何信息。插图文件,据我所知,该文件已自动化。
因此,我的问题是 - 在iPad上是开发人员的Swift Playgrounds应用中,是否可以使用HealthKit?如果是 - 如何设置nshealthupdateusagedescription?
I'm trying to connect my Swift Playgrounds app which is being developed on iPad to Apple Watch. Importing HealthKit in swift file and accessing its classes and methods works perfectly, but in a runtime I get an error saying that NSHealthUpdateUsageDescription key should be set in info.plist file. The problem is that iPad Swift Playgrounds app does not have any info.plist file and as far as I know this file is autogenerated.
So my question is - is it possible at all to use HealthKit in Swift Playgrounds app which is being developer on iPad? If yes - how can I set up NSHealthUpdateUsageDescription?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
截至2023年3月6日,最新版本的Swift Playgrounds似乎无法添加HealthKit功能。由于为了使用HealthKit,这是必需的,因此目前似乎无法在iPad上的Swift Playgrounds中使用HealthKit。
With the latest version of Swift Playgrounds as of March 6, 2023, it doesn’t look like you can add the HealthKit capability. Since this is required in order to use HealthKit, it seems like there is currently no way to use HealthKit in Swift Playgrounds on iPad.