tinode / ios

Tinodios: Tinode Messaging Client for iOS
Apache License 2.0
245 stars 109 forks source link

When loading older messages, keep MessageVC at the top of the message list #158

Closed aforge closed 2 years ago

aforge commented 4 years ago

When the user opens a chat, Tinodios loads the latest 24 messages by default. In order to load older messages in a chat (in the MessageVC), the user scrolls the message list to the top (by swiping down the message list) and upon reaching the top swipes it down once again - which triggers the loading logic. However, upon loading a batch of older messages (from either local storage or, if not available locally, from the server) the MessageVC always scrolls down the message list all the way to bottom. It is annoying because in order to get to the newly loaded messages the user must scroll all the way up through the message list again.

Describe the solution you'd like Upon loading older messages, keep the MessageVC at the top of the message list.

Additional context See logic in https://github.com/tinode/ios/blob/devel/Tinodios/MessageViewController.swift, https://github.com/tinode/ios/blob/devel/Tinodios/MessageInteractor.swift and https://github.com/tinode/ios/blob/devel/Tinodios/MessagePresenter.swift

or-else commented 2 years ago

This is fixed.