我有一个场景,我必须旋转我的模拟器,而xcode ui测试正在进行。如何旋转模拟器使用xcode中的swift代码ui test
要旋转模拟器,我用下面的代码
UIDevice.currentDevice().orientation
let value = UIInterfaceOrientation.LandscapeLeft.rawValue
UIDevice.currentDevice().setValue(value, forKey: "orientation")
,但它无法正常工作。
是否有任何解决方案在xcode ui测试中使用swift代码旋转模拟器?
谢谢
尝试此[如何旋转模拟器(http://stackoverflow.com/问题/ 15642135/how-do-i-rotate-the-ios-simulator-using-code) – iDeveloper