Passing touch events to iOS status bar

后端 未结 3 1689
误落风尘
误落风尘 2021-01-03 12:38

I have a UIWindow with windowLevel set to UIWindowLevelStatusBar+1. This window has a single semi-transparent view that blocks the status bar. I need to sometimes pass touch

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-03 13:04

    As far as I understand this, you should use - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event to implement that behavior. Basically, you either return self if you want to handle the touch event or [super hitTest:point withEvent:event] to let the status bar handle the touch event.

    Check out the UIView Class Reference for more.

    EDIT: As Jonathan mentioned, Apple might not approve this.

提交回复
热议问题