gpt4 book ai didi

ios - 识别是否在模拟器ios9中运行

转载 作者:行者123 更新时间:2023-11-28 09:27:55 25 4
gpt4 key购买 nike

<分区>

在 ios9 之前,我检查设备的型号名称以检查应用程序是否在模拟器中运行。

if UIDevice.currentDevice().model != "iPhone Simulator" {
// Device
}
else {
// Simulator
}

但是现在使用 xcode7 和 ios9 Swift2.0,模拟器的型号名称现在只是 iPhone,而我的真实设备也是。

我的肮脏方法不再有效,更好的解决方案是什么?

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