【发布时间】:2017-02-03 18:44:44
【问题描述】:
我有一个场景,我必须在进行 xcode ui 测试时旋转我的模拟器。
为了旋转模拟器,我使用下面的代码
UIDevice.currentDevice().orientation
let value = UIInterfaceOrientation.LandscapeLeft.rawValue
UIDevice.currentDevice().setValue(value, forKey: "orientation")
但它不起作用。
在 xcode ui 测试中使用 Swift 代码旋转模拟器有什么解决方案吗?
【问题讨论】:
标签: ios swift xcode xctest xcode-ui-testing