Testing in iOS - Part 27: Multidevice UI Testing | Ray Wenderlich

Some UI tests on iPhones won't work on iPads. This video gives you strategies on dealing with the issue.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/3530-testing-in-ios/lessons/27

Iā€™m getting this error message:

return UIDeviceOrientationIsPortrait(XCUIDevice.shared.orientation)

ā€œā€˜UIDeviceOrientationIsPortraitā€™ has been replaced by property ā€˜UIDeviceOrientation.isPortraitā€™ā€

and when I changed it:

 return UIDeviceOrientation.IsPortrait(XCUIDevice.shared.orientation)

"Type ā€˜UIDeviceOrientationā€™ has no member ā€˜IsPortraitā€™

Why is this and why am I getting this error when the tutorial is not? How do I fix it? Thanks

Capital I should be lowercase i ?

Thanks sgerrard but I tried that and had no luck.

Maybe it is an instance property now, not a class property.

See if you can get somewhere with

return XCUIDevice.shared.orientation.isPortrait