mirror of
https://github.com/MessageKit/MessageKit.git
synced 2026-02-06 19:03:19 +00:00
Merge pull request #606 from zhongwuzw/fix-layout
Support custom CellSizeCalculator not restrict to MessageSizeCalculator
This commit is contained in:
@@ -114,7 +114,7 @@ open class MessagesCollectionViewFlowLayout: UICollectionViewFlowLayout {
|
||||
open var videoMessageSizeCalculator = MediaMessageSizeCalculator()
|
||||
open var locationMessageSizeCalculator = LocationMessageSizeCalculator()
|
||||
|
||||
open func cellSizeCalculatorForItem(at indexPath: IndexPath) -> MessageSizeCalculator {
|
||||
open func cellSizeCalculatorForItem(at indexPath: IndexPath) -> CellSizeCalculator {
|
||||
let message = messagesDataSource.messageForItem(at: indexPath, in: messagesCollectionView)
|
||||
switch message.data {
|
||||
case .text:
|
||||
|
||||
@@ -54,7 +54,7 @@ public enum MessageData {
|
||||
/// A custom message.
|
||||
/// - Note: Using this case requires that you override the following methods and handle this case:
|
||||
/// - `collectionView(_:cellForItemAt indexPath: IndexPath) -> UICollectionViewCell`
|
||||
/// - `cellSizeCalculatorForItem(at indexPath: IndexPath) -> MessageSizeCalculator`
|
||||
/// - `cellSizeCalculatorForItem(at indexPath: IndexPath) -> CellSizeCalculator`
|
||||
case custom(Any?)
|
||||
|
||||
// MARK: - Not supported yet
|
||||
|
||||
Reference in New Issue
Block a user