Skip to content

Commit

Permalink
Scroll view did finish scrolling observation
Browse files Browse the repository at this point in the history
  • Loading branch information
just-software-dev committed Sep 26, 2024
1 parent ab117ab commit e5abc37
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Adamant/Modules/Chat/View/ChatViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,12 @@ final class ChatViewController: MessagesViewController {
}

override func scrollViewDidEndDecelerating(_: UIScrollView) {
viewModel.startHideDateTimer()
scrollDidStop()
}

override func scrollViewDidEndDragging(_: UIScrollView, willDecelerate: Bool) {
guard !willDecelerate else { return }
scrollDidStop()
}

override func scrollViewDidScroll(_ scrollView: UIScrollView) {
Expand Down Expand Up @@ -282,6 +287,10 @@ extension ChatViewController {
// MARK: Observers

private extension ChatViewController {
func scrollDidStop() {
viewModel.startHideDateTimer()
}

func setupObservers() {
NotificationCenter.default
.publisher(for: UITextView.textDidChangeNotification, object: inputBar.inputTextView)
Expand Down

0 comments on commit e5abc37

Please sign in to comment.