3

私のアプリでは、ステータスバーがタップされたときにカスタムビューを表示するようにトリガーする必要があります。UIApplicationをサブクラス化して、イベントを取得する方法を見つけました。

以下のコードを使用すると、AppleはプライベートAPIの使用のためにアプリをブロックしますか?

- (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];
}

ご意見をお聞かせください...

4

1 に答える 1

0

それはインターフェースと人間のガイドラインに反します

于 2012-03-22T23:00:38.200 に答える