Repository navigation
Document the MessagesCollectionView scroll methods - #1929
Merged
martinpucik merged 2 commits intoNov 1, 2026
Merged
Conversation
scrollToLastItem(at:animated:), scrollToBottom(animated:) and reloadDataAndKeepOffset() had no documentation, so it was unclear why scrollToLastItem leaves the bottom section inset out of view (MessageKit#1874, MessageKit#1830) and that scrollToBottom exists to scroll past it. Add doc comments, replace the stale note on scrollsToLastItemOnKeyboardBeginsEditing that pointed at a flag that no longer exists, and add a FAQ entry on scrolling to the newest message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kdtqz9Dvfv2BXcyucfWtkK
Kaspik
approved these changes
Nov 1, 2026
martinpucik
enabled auto-merge
November 1, 2026 21:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this implement/fix? Explain your changes.
scrollToLastItem(at:animated:),scrollToBottom(animated:)andreloadDataAndKeepOffset()onMessagesCollectionViewhad no documentation. That left people unsure whyscrollToLastItemstops with a gap under the newest message, and unaware thatscrollToBottomexists to scroll past it.scrollToLastItemlines the last cell up with the bottom of the visible area, which keeps the layout'ssectionInset.bottomout of view, whilescrollToBottomscrolls past that inset to the end of the content. They also say whenMessagesViewControllercallsscrollToLastItemitself.scrollsToLastItemOnKeyboardBeginsEditing. It pointed at "the below flag related toscrollToBottom", and that flag no longer exists.// NOTEthat pointed at Random crash when callingscrollToBottomwith "Invalid update: invalid number of items in section 0" #725. That issue was a closed batch-update crash, not a limitation of the method.Only comments and docs change. There is no change in behaviour.
Does this close any currently open issues?
It answers the question in #1874 and #1830, though neither is closed by it: those issues ask about the behaviour, and this PR documents it rather than changing it.
Any relevant logs, error output, etc?
None.
Any other comments?
The open PR #1832 changes the body of
scrollToLastItem. This PR touches only the comment lines above that method, so if both are merged, any conflict will be limited to those comment lines.Where has this been tested?
Devices/Simulators: N/A. Only documentation and comments change.
iOS Version: N/A
Swift Version: N/A
MessageKit Version: main
Generated by Claude Code