gpt4 book ai didi

ios - 如何判断我在 Xcode UI 测试中使用的是哪个设备?

转载 作者:IT王子 更新时间:2023-10-29 08:08:47 25 4
gpt4 key购买 nike

当 Xcode UI 测试正在运行时,我想知道正在使用哪个设备/环境(例如 iPad Air 2、iOS 9.0、模拟器)。

我怎样才能得到这些信息?

最佳答案

使用 Swift 3(根据需要将 .pad 更改为 .phone):

if UIDevice.current.userInterfaceIdiom == .pad {
// Ipad specific checks
}

使用旧版本的 Swift:

UIDevice.currentDevice().userInterfaceIdiom

关于ios - 如何判断我在 Xcode UI 测试中使用的是哪个设备?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32298633/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com