Open soroushjp opened 11 years ago
Thanks a lot for this.
I've been wondering how to implement auto scroll without learning all the BubbleTableView implementation!
No worries, glad it helped. I'm working a lot with this library in my project and have been through the implementation so let me know if you run into any other issues.
Hey, I am having a problem. It doesn't let me scroll to bottom anytime. As soon as i scroll to the bottom and release it, it automatically scrolls back to the middle.
If you have a solution or perhaps a reason for this occurrence, please help me. Thanks in advance
@soroushjp solution does not work because there is still an issue with the function animateTextField.
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.