uidevice.current.userinterfaceidiom即使在iPad上运行该应用时也是电话

发布于 2025-02-09 14:58:56 字数 754 浏览 1 评论 0原文

问题:

如果我将iPad作为我要部署到的设备,如下所示:

然后在我的iPad上使用debug/testflight运行我的应用/11104068“>从这里)返回电话而不是pad

问题:

如何在此状态下检测该应用程序在iPad上运行?

上下文

问题是此楼梯登山者应用程序,您可以在此处进行测试要求HealthKit工作,iPad没有健康应用程序,所以我不能将航班爬入应用程序,所以该应用程序基本上没有用。即使我取消了iPad,并且不要在列表中添加iPad图片,App Store评论团队也拒绝了我的iPad上的UX---。这就是为什么如果用户不使用iPhone,我希望用户有不同的体验。

Problem:

If I deselect iPad as a device that I want to deploy to, as shown below:
enter image description here

and then run my app using debug/TestFlight on my iPad, UIDevice.current.userInterfaceIdiom (from here) returns phone instead of pad.

Question:

How can I detect that the app is running on an iPad in this state?

Context

The problem is that this Stair Climber app, that you can test here requires HealthKit to work, and iPads don't have the Health app, so I can't pull in Flights Climbed data into the app, so the app is basically useless. And even though I deselect iPad and don't add iPad pictures to the listing, the App Store review team rejected me for the UX on iPads -,-. That is why I want the user to have a different experience if they are not using iPhones.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

多孤肩上扛 2025-02-16 14:58:57

uidevice.current.userinterfaceidiom不是关于设备的,而是关于当前有效的接口成语,而是您实际上关闭了。

您可以使用uidevice.current.model属性来检测实际设备是否为iPad。

UIDevice.current.userInterfaceIdiom is not about device but about currently active interface idiom of the supported, but which you actually turned off.

You can use UIDevice.current.model property to detect if real device is iPad.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文