iOS 16 beta get local status bar

When I trying to get a local status bar with the following code:

UIApplication *app = [UIApplication sharedApplication];
if (@available(iOS 13.0, *)) {
    __block id statusBarManager = [[[app valueForKey:@"keyWindow"]
                       valueForKey:@"windowScene"]
                      valueForKey:@"statusBarManager"];
           #pragma GCC diagnostic ignored "-Wundeclared-selector"
    
    __block UIView *localStatusBar = nil;
    if ([statusBarManager respondsToSelector:@selector(createLocalStatusBar)]) {
        if ([NSThread isMainThread]) {
            localStatusBar = [statusBarManager performSelector:@selector(createLocalStatusBar)];
        }
        else {
            dispatch_sync(dispatch_get_main_queue(), ^{
                localStatusBar = [statusBarManager performSelector:@selector(createLocalStatusBar)];
            });
        }
        return [localStatusBar valueForKey:StatusBarKey];
    }
    return nil;
} else {
    return [app valueForKey:StatusBarKey];
}

I always get a nil object from the method call statusBarManager performSelector:@selector(createLocalStatusBar) under iOS 16.

When I run the same Code on iOS 13, 14 and 15.6 I always get an object.

I need the status bar to get several different information, currently mainly to recognize if the phone is in the Flight mode.

Does some one have an idea to get it running or have an alternative for the recognition of the flight mode?

iOS 16 beta get local status bar
 
 
Q