Last active
December 22, 2022 08:55
-
-
Save ilia3546/670009151d48a4e941b5de08fcf0e9b8 to your computer and use it in GitHub Desktop.
Tap simulation on UIStatusBar for manual scrolling to top. Dangerous - Private API!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
public extension UIStatusBarManager { | |
func scrollToTop() { | |
let selector = NSSelectorFromString("handleTapAction:") | |
let action = UIStatusBarTapAction() | |
perform(selector, with: action) | |
} | |
} | |
@objc | |
private class UIStatusBarTapAction: NSObject { | |
@objc var type: NSInteger = 0 | |
@objc var xPosition: Double = 50 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment