mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-15 13:14:10 +00:00
git-subtree-dir: submodules/Display git-subtree-mainline: 9bc996374ffdad37aef175427db72731c9551dcf git-subtree-split: 7bd11013ea936e3d49d937550d599f5816d32560
32 lines
898 B
Swift
32 lines
898 B
Swift
import UIKit
|
|
|
|
class ListViewScroller: UIScrollView, UIGestureRecognizerDelegate {
|
|
override init(frame: CGRect) {
|
|
super.init(frame: frame)
|
|
|
|
#if os(iOS)
|
|
self.scrollsToTop = false
|
|
if #available(iOSApplicationExtension 11.0, *) {
|
|
self.contentInsetAdjustmentBehavior = .never
|
|
}
|
|
#endif
|
|
}
|
|
|
|
required init?(coder aDecoder: NSCoder) {
|
|
fatalError("init(coder:) has not been implemented")
|
|
}
|
|
|
|
@objc func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
|
|
if otherGestureRecognizer is ListViewTapGestureRecognizer {
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
#if os(iOS)
|
|
override func touchesShouldCancel(in view: UIView) -> Bool {
|
|
return true
|
|
}
|
|
#endif
|
|
}
|