mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-01 16:06:59 +00:00
Implement scrollToTop
This commit is contained in:
parent
3697b76022
commit
6400232893
@ -130,7 +130,7 @@ final class ContactsSearchContainerNode: SearchDisplayControllerContentNode {
|
||||
private let openPeer: (ContactListPeer) -> Void
|
||||
|
||||
private let dimNode: ASDisplayNode
|
||||
private let listNode: ListView
|
||||
let listNode: ListView
|
||||
|
||||
private let searchQuery = Promise<String?>()
|
||||
private let searchDisposable = MetaDisposable()
|
||||
@ -317,6 +317,12 @@ final class ContactsSearchContainerNode: SearchDisplayControllerContentNode {
|
||||
self.searchDisposable.dispose()
|
||||
}
|
||||
|
||||
override func scrollToTop() {
|
||||
if !self.listNode.isHidden {
|
||||
self.listNode.transaction(deleteIndices: [], insertIndicesAndItems: [], updateIndicesAndItems: [], options: [.Synchronous, .LowLatency], scrollToItem: ListViewScrollToItem(index: 0, position: .top(0.0), animated: true, curve: .Default(duration: nil), directionHint: .Up), updateSizeAndInsets: nil, stationaryItemRange: nil, updateOpaqueState: nil, completion: { _ in })
|
||||
}
|
||||
}
|
||||
|
||||
override func didLoad() {
|
||||
super.didLoad()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user