Skip to content

Instantly share code, notes, and snippets.

@ilia3546
Last active December 22, 2022 08:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ilia3546/670009151d48a4e941b5de08fcf0e9b8 to your computer and use it in GitHub Desktop.
Save ilia3546/670009151d48a4e941b5de08fcf0e9b8 to your computer and use it in GitHub Desktop.
Tap simulation on UIStatusBar for manual scrolling to top. Dangerous - Private API!
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