iOS13: how to detect a status bar click event?

后端 未结 2 1916
渐次进展
渐次进展 2021-02-01 09:00

In my appDelegate, I override touchesBegan to detect when the status bar is clicked:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)even         


        
2条回答
  •  执笔经年
    2021-02-01 09:55

    In iOS 13, StatusBar Event was managed by UIStatusBarManager, these methods will be called when click the StatusBar:

    -[UIStatusBarManager _handleScrollToTopAtXPosition:]
    -[UIStatusBarManager handleTapAction:]
    

    So, you can hook -[UIStatusBarManager handleTapAction:] to detecte StatusBar click event

提交回复
热议问题