Skip to content

Commit e889f98

Browse files
committed
Fixed orientation bug on iOS5. fixes wordpress-mobile#1582
1 parent 4588461 commit e889f98

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

WordPress/Classes/UINavigationController+Rotation.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,18 @@ - (NSUInteger)mySupportedInterfaceOrientations {
2525
return UIInterfaceOrientationMaskAll;
2626
}
2727

28+
- (BOOL)myShouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
29+
return ([self mySupportedInterfaceOrientations] & toInterfaceOrientation) ? YES : NO;
30+
}
2831

2932
+ (void)load {
3033
Method origMethod = class_getInstanceMethod(self, @selector(supportedInterfaceOrientations));
3134
Method newMethod = class_getInstanceMethod(self, @selector(mySupportedInterfaceOrientations));
3235
method_exchangeImplementations(origMethod, newMethod);
36+
37+
origMethod = class_getInstanceMethod(self, @selector(shouldAutorotateToInterfaceOrientation:));
38+
newMethod = class_getInstanceMethod(self, @selector(myShouldAutorotateToInterfaceOrientation:));
39+
method_exchangeImplementations(origMethod, newMethod);
3340
}
3441

3542

0 commit comments

Comments
 (0)