This repository has been archived by the owner on Mar 9, 2018. It is now read-only.
Autoscroll added, automatically moves to bottom of chat UIBubbleTableView when reloadData is called. #45
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.
For me, I wanted my chat to scroll to bottom on arrival of a new message. Conveniently, this is when reloadData is called, so until a developer options list is made available, this seems like a great solution for most use cases.
If this would be better served as an optional parameter, I can code it up, just let me know.
EDIT: I refactored this code out as a scrollToBottom instance method. This could make sense as a function left accessible for the user so they can call it as needed, instead of building an autoscroll option or forcing it on people using the library. Just an idea. For now, left in reloadData method to act as autoscroll.
EDIT2: For my own application, I needed a place without animation during scrolling, so I extended this method to scrollToBottomWithAnimation:(BOOL)animated. I then put this in the header as an accessible method for the rest of my controllers. If this seems useful, let me know, I will submit a separate pull request.
EDIT3: I added the optional animation code and added method prototype to header. Let me know if this is not the route you want to take with the project.