uidevice.current.userinterfaceidiom即使在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:
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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.