mirror of
https://github.com/MessageKit/MessageKit.git
synced 2026-02-06 19:03:19 +00:00
Make requested changes from @zhongwuzw
This commit is contained in:
@@ -182,24 +182,6 @@ final class AdvancedExampleViewController: ChatViewController {
|
||||
messagesCollectionView.scrollToBottom(animated: true)
|
||||
}
|
||||
|
||||
func isLastSectionVisible() -> Bool {
|
||||
|
||||
let lastIndexPath = IndexPath(item: 0, section: messageList.count - 1)
|
||||
|
||||
let frame = messagesCollectionView.layoutAttributesForItem(at: lastIndexPath)?.frame ?? .zero
|
||||
var rect = messagesCollectionView.convert(frame, to: view)
|
||||
|
||||
// substract 100 to make the "visible" area of a cell bigger
|
||||
rect.origin.y -= 100
|
||||
|
||||
var visibleRect = CGRect(x: messagesCollectionView.bounds.origin.x, y: messagesCollectionView.bounds.origin.y, width:
|
||||
messagesCollectionView.bounds.size.width, height:
|
||||
messagesCollectionView.bounds.size.height - messagesCollectionView.contentInset.bottom)
|
||||
|
||||
visibleRect = messagesCollectionView.convert(visibleRect, to: view)
|
||||
return visibleRect.contains(rect)
|
||||
}
|
||||
|
||||
private func makeButton(named: String) -> InputBarButtonItem {
|
||||
return InputBarButtonItem()
|
||||
.configure {
|
||||
|
||||
Reference in New Issue
Block a user