私のアプリでは、ステータスバーがタップされたときにカスタムビューを表示するようにトリガーする必要があります。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];
}
ご意見をお聞かせください...