File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments