Pregunta

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...

¿Fue útil?

Solución

it is against the interface and human guidelines

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top