mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-29 09:01:05 +00:00
41 lines
1.0 KiB
Swift
41 lines
1.0 KiB
Swift
import UIKit
|
|
|
|
private class GridNodeScrollerLayer: CALayer {
|
|
override func setNeedsDisplay() {
|
|
}
|
|
}
|
|
|
|
private class GridNodeScrollerView: UIScrollView {
|
|
override class var layerClass: AnyClass {
|
|
return GridNodeScrollerLayer.self
|
|
}
|
|
|
|
override func touchesShouldCancel(in view: UIView) -> Bool {
|
|
return true
|
|
}
|
|
|
|
@objc func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
|
|
return false
|
|
}
|
|
}
|
|
|
|
open class GridNodeScroller: ASDisplayNode, UIGestureRecognizerDelegate {
|
|
var scrollView: UIScrollView {
|
|
return self.view as! UIScrollView
|
|
}
|
|
|
|
override init() {
|
|
super.init()
|
|
|
|
self.setViewBlock({
|
|
return GridNodeScrollerView()
|
|
})
|
|
|
|
self.scrollView.scrollsToTop = false
|
|
}
|
|
|
|
required public init?(coder aDecoder: NSCoder) {
|
|
fatalError("init(coder:) has not been implemented")
|
|
}
|
|
}
|