Question

In my app I have need to trigger show some custom view when status bar is tapped. I figured out the way to get the event by subclassing UIApplication.

If I use the code below will Apple block my app for private API usage?

- (void)sendEvent:(UIEvent *)event{
    [[event allTouches] enumerateObjectsUsingBlock:^(UITouch * touch,BOOL * stop){
        if (touch.tapCount==1 && touch.phase==UITouchPhaseEnded) {
            NSString * touchedViewClassName = NSStringFromClass([touch.view class]);
            if ([touchedViewClassName isEqualToString:@"UIStatusBarForegroundView"]) {
                [[NSNotificationCenter defaultCenter] postNotificationName:@"StatusBarTapped" object:nil];
            }
        }
    }];
    [super sendEvent:event];
}

Please advice...

Était-ce utile?

La solution

it is against the interface and human guidelines

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top