Reputation: 6393
I'm writing a test on a UIViewController
. The test has the purpose of testing a state that is only triggered when the device is in portrait mode. Is there a (relatively) simple way to set the "orientation" to portrait to make sure the required code-calls are made?
Upvotes: 0
Views: 96
Reputation: 9593
There are two private UIApplication
methods: rotateIfNeeded:
and rotateIfNeeded:completion:
which you can use during testing.
Make sure to wrap invocations with #ifdef
statement, so they don't go into distribution build.
Upvotes: 1