Skip to content

Commit be49f3d

Browse files
Define rotateDeviceToOrientation using rotateInterfaceToOrientation
This ensures that the deprecated method is not called anymore. This also avoids to transform the orientation from interface to device to interface.
1 parent 68ab736 commit be49f3d

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

TestLib/EarlGreyImpl/EarlGreyImpl.m

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -265,22 +265,21 @@ - (void)setRootMatcherForSubsequentInteractions:(nullable id<GREYMatcher>)rootWi
265265

266266
#if TARGET_OS_IOS
267267

268-
- (BOOL)rotateInterfaceToOrientation:(UIInterfaceOrientation)interfaceOrientation
269-
error:(NSError **)error {
270-
UIDeviceOrientation deviceOrientation =
271-
[GREYConstants deviceOrientationForInterfaceOrientation:interfaceOrientation];
272-
return [self rotateDeviceToOrientation:deviceOrientation error:error];
268+
- (BOOL)rotateDeviceToOrientation:(UIDeviceOrientation)deviceOrientation
269+
error:(NSError **)error {
270+
UIInterfaceOrientation interfaceOrientation =
271+
[GREYConstants interfaceOrientationForDeviceOrientation:deviceOrientation];
272+
return [self rotateInterfaceToOrientation:interfaceOrientation error:error];
273273
}
274274

275-
- (BOOL)rotateDeviceToOrientation:(UIDeviceOrientation)deviceOrientation error:(NSError **)error {
275+
- (BOOL)rotateInterfaceToOrientation:(UIInterfaceOrientation)interfaceOrientation
276+
error:(NSError **)error {
276277
GREYError *syncErrorBeforeRotation;
277278
__block GREYError *syncErrorAfterRotation;
278279
BOOL success = NO;
279280
__block BOOL sendOrientationChangeNotification = NO;
280281
XCUIDevice *sharedDevice = [XCUIDevice sharedDevice];
281282
UIDevice *currentDevice = [GREY_REMOTE_CLASS_IN_APP(UIDevice) currentDevice];
282-
UIInterfaceOrientation interfaceOrientation =
283-
[GREYConstants interfaceOrientationForDeviceOrientation:deviceOrientation];
284283
if (interfaceOrientation != UIInterfaceOrientationUnknown) {
285284

286285
NSNotificationCenter *notificationCenter =

0 commit comments

Comments
 (0)