我希望在使用任何测试时将相机屏幕旋转到左侧,否则将其保持为rotateRight。
以下是主架构代码
UIDevice.current.setValue(UIInterfaceOrientation.landscapeRight.rawValue, forKey: "orientation")
但我想在使用此
的测试架构时将其更改为landscapeLeft指出我保持一定条件的正确方向。
我使用的是Swift 4,Xcode 9.2。
答案 0 :(得分:0)
假设这是一个UI测试,您应该能够在测试方法的顶部执行以下操作:
XCUIDevice.shared().orientation = .landscapeLeft