Various improvements

This commit is contained in:
Ilya Laktyushin
2024-07-16 02:41:00 +04:00
parent 3b5fc9afb3
commit b4cc4e0bd0
13 changed files with 348 additions and 35 deletions

View File

@@ -193,6 +193,10 @@ final class StarsStatisticsScreenComponent: Component {
deinit {
self.stateDisposable?.dispose()
}
func scrollToTop() {
self.scrollView.setContentOffset(CGPoint(x: 0.0, y: -self.scrollView.contentInset.top), animated: true)
}
func scrollViewDidScroll(_ scrollView: UIScrollView) {
if !self.ignoreScrolling {
@@ -783,6 +787,13 @@ public final class StarsStatisticsScreen: ViewControllerComponentContainer {
}
self.transactionsContext.loadMore()
self.scrollToTop = { [weak self] in
guard let self, let componentView = self.node.hostView.componentView as? StarsStatisticsScreenComponent.View else {
return
}
componentView.scrollToTop()
}
}
required public init(coder aDecoder: NSCoder) {