Merge pull request #606 from zhongwuzw/fix-layout

Support custom CellSizeCalculator not restrict to MessageSizeCalculator
This commit is contained in:
Steven Deutsch
2018-03-29 19:46:26 -05:00
committed by GitHub
2 changed files with 2 additions and 2 deletions
@@ -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:
+1 -1
View File
@@ -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