MessagesLayoutDelegate

public protocol MessagesLayoutDelegate: AnyObject

A protocol used by the MessagesCollectionViewFlowLayout object to determine the size and layout of a MessageCollectionViewCell and its contents.

  • headerViewSize(for:in:) Default implementation

    Specifies the size to use for a header view.

    Note

    The default value returned by this method is a size of GGSize.zero.

    Default Implementation

    Declaration

    Swift

    func headerViewSize(for section: Int, in messagesCollectionView: MessagesCollectionView) -> CGSize

    Parameters

    section

    The section number of the header.

    messagesCollectionView

    The MessagesCollectionView in which this header will be displayed.

  • footerViewSize(for:in:) Default implementation

    Specifies the size to use for a footer view.

    Note

    The default value returned by this method is a size of GGSize.zero.

    Default Implementation

    Declaration

    Swift

    func footerViewSize(for section: Int, in messagesCollectionView: MessagesCollectionView) -> CGSize

    Parameters

    section

    The section number of the footer.

    messagesCollectionView

    The MessagesCollectionView in which this footer will be displayed.

  • cellTopLabelHeight(for:at:in:) Default implementation

    Specifies the height for the MessageContentCell‘s top label.

    Note

    The default value returned by this method is zero.

    Default Implementation

    Declaration

    Swift

    func cellTopLabelHeight(for message: MessageType, at indexPath: IndexPath, in messagesCollectionView: MessagesCollectionView) -> CGFloat

    Parameters

    message

    The MessageType that will be displayed for this cell.

    indexPath

    The IndexPath of the cell.

    messagesCollectionView

    The MessagesCollectionView in which this cell will be displayed.

  • messageTopLabelHeight(for:at:in:) Default implementation

    Specifies the height for the message bubble’s top label.

    Note

    The default value returned by this method is zero.

    Default Implementation

    Declaration

    Swift

    func messageTopLabelHeight(for message: MessageType, at indexPath: IndexPath, in messagesCollectionView: MessagesCollectionView) -> CGFloat

    Parameters

    message

    The MessageType that will be displayed for this cell.

    indexPath

    The IndexPath of the cell.

    messagesCollectionView

    The MessagesCollectionView in which this cell will be displayed.

  • messageBottomLabelHeight(for:at:in:) Default implementation

    Specifies the height for the MessageContentCell‘s bottom label.

    Note

    The default value returned by this method is zero.

    Default Implementation

    Declaration

    Swift

    func messageBottomLabelHeight(for message: MessageType, at indexPath: IndexPath, in messagesCollectionView: MessagesCollectionView) -> CGFloat

    Parameters

    message

    The MessageType that will be displayed for this cell.

    indexPath

    The IndexPath of the cell.

    messagesCollectionView

    The MessagesCollectionView in which this cell will be displayed.