mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-02 00:17:02 +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 openPeer: (ContactListPeer) -> Void
|
||||||
|
|
||||||
private let dimNode: ASDisplayNode
|
private let dimNode: ASDisplayNode
|
||||||
private let listNode: ListView
|
let listNode: ListView
|
||||||
|
|
||||||
private let searchQuery = Promise<String?>()
|
private let searchQuery = Promise<String?>()
|
||||||
private let searchDisposable = MetaDisposable()
|
private let searchDisposable = MetaDisposable()
|
||||||
@ -317,6 +317,12 @@ final class ContactsSearchContainerNode: SearchDisplayControllerContentNode {
|
|||||||
self.searchDisposable.dispose()
|
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() {
|
override func didLoad() {
|
||||||
super.didLoad()
|
super.didLoad()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user