Deprecated scrollToBottom() in favor of scrollToLastItem() (#1505)

* refactor: deprecated scrollToBottom() in favor of scrollToLastItem

* refactor: deprecated scrollToBottom() in favor of scrollToLastItem

Changelog
This commit is contained in:
Martin Púčik
2020-12-03 19:09:21 +01:00
committed by GitHub
parent b1e523a020
commit 696eb34dc2
8 changed files with 73 additions and 33 deletions
@@ -1,7 +1,7 @@
/*
MIT License
Copyright (c) 2017-2019 MessageKit
Copyright (c) 2017-2020 MessageKit
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -60,7 +60,7 @@ final class AdvancedExampleViewController: ChatViewController {
DispatchQueue.main.async {
self.messageList = messages
self.messagesCollectionView.reloadData()
self.messagesCollectionView.scrollToBottom()
self.messagesCollectionView.scrollToLastItem()
}
}
}
@@ -202,7 +202,7 @@ final class AdvancedExampleViewController: ChatViewController {
updateTitleView(title: "MessageKit", subtitle: isHidden ? "2 Online" : "Typing...")
setTypingIndicatorViewHidden(isHidden, animated: true, whilePerforming: updates) { [weak self] success in
if success, self?.isLastSectionVisible() == true {
self?.messagesCollectionView.scrollToBottom(animated: true)
self?.messagesCollectionView.scrollToLastItem(animated: true)
}
}
}