mirror of
https://github.com/MessageKit/MessageKit.git
synced 2026-02-06 19:03:19 +00:00
Merge branch 'development' of https://github.com/MessageKit/MessageKit into tagonsoft_development
# Conflicts: # Example/Podfile.lock # Example/Sources/View Controllers/ChatViewController.swift # MessageKit.xcodeproj/project.pbxproj # Sources/Protocols/MessageCellDelegate.swift
This commit is contained in:
@@ -135,18 +135,7 @@ class ChatViewController: MessagesViewController, MessagesDataSource {
|
||||
|
||||
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)
|
||||
return messagesCollectionView.indexPathsForVisibleItems.contains(lastIndexPath)
|
||||
}
|
||||
|
||||
// MARK: - MessagesDataSource
|
||||
@@ -244,6 +233,10 @@ extension ChatViewController: MessageCellDelegate {
|
||||
print("Did stop audio sound")
|
||||
}
|
||||
|
||||
func didTapAccessoryView(in cell: MessageCollectionViewCell) {
|
||||
print("Accessory view tapped")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// MARK: - MessageLabelDelegate
|
||||
|
||||
Reference in New Issue
Block a user