In B4I I created a new project and added
#if OBJC
@end
@interface UIViewController (Test)
@end
@implementation UIViewController (Test)
- (BOOL) shouldAutorotate { NSLog (@"shouldAutorotate"); return true; }
- (BOOL) prefersStatusBarHidden { NSLog(@"StatusBar"); return YES; }
- (UIStatusBarStyle) preferredStatusBarStyle { NSLog(@"StatusBarStyle"); return UIStatusBarStyleLightContent; }
#End If
shouldAutorotate is called, other methods - not.
In Catalyna, XCode 11.1 I created a new project using "Tabbed App". In FirstViewController.m inside @implementation FirstViewController I added
- (UIStatusBarStyle) preferredStatusBarStyle { NSLog(@"FirstView: preferredStatusBarStyle"); return UIStatusBarStyleLightContent; }
- (BOOL) prefersStatusBarHidden { NSLog(@"FirstView: prefersStatusBarHidden"); return YES; }
Then an analog code for SecondViewController.
- (BOOL) prefersStatusBarHidden { NSLog(@"SecondView: prefersStatusBarHidden"); return NO; }
- (UIStatusBarStyle) preferredStatusBarStyle { NSLog(@"SecondView: preferredStatusBarStyle"); return UIStatusBarStyleDarkContent; }
Works fine.
After this I added to main.m the same code as in B4I. IOS works as expected (methods are called inside main.m and First/SecondViewController).