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 implementationSpecifies 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) -> CGSizeParameters
sectionThe section number of the header.
messagesCollectionViewThe
MessagesCollectionViewin which this header will be displayed. -
footerViewSize(for:in:)Default implementationSpecifies 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) -> CGSizeParameters
sectionThe section number of the footer.
messagesCollectionViewThe
MessagesCollectionViewin which this footer will be displayed. -
cellTopLabelHeight(for:at:in:)Default implementationSpecifies 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) -> CGFloatParameters
messageThe
MessageTypethat will be displayed for this cell.indexPathThe
IndexPathof the cell.messagesCollectionViewThe
MessagesCollectionViewin which this cell will be displayed. -
messageTopLabelHeight(for:at:in:)Default implementationSpecifies 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) -> CGFloatParameters
messageThe
MessageTypethat will be displayed for this cell.indexPathThe
IndexPathof the cell.messagesCollectionViewThe
MessagesCollectionViewin which this cell will be displayed. -
messageBottomLabelHeight(for:at:in:)Default implementationSpecifies 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) -> CGFloatParameters
messageThe
MessageTypethat will be displayed for this cell.indexPathThe
IndexPathof the cell.messagesCollectionViewThe
MessagesCollectionViewin which this cell will be displayed.
-
avatarSize(for:at:in:)Extension methodUndocumented
Declaration
Swift
func avatarSize(for message: MessageType, at indexPath: IndexPath, in messagesCollectionView: MessagesCollectionView) -> CGSize -
avatarPosition(for:at:in:)Extension methodUndocumented
Declaration
Swift
func avatarPosition(for message: MessageType, at indexPath: IndexPath, in messagesCollectionView: MessagesCollectionView) -> AvatarPosition -
messageLabelInset(for:at:in:)Extension methodUndocumented
Declaration
Swift
func messageLabelInset(for message: MessageType, at indexPath: IndexPath, in messagesCollectionView: MessagesCollectionView) -> UIEdgeInsets -
messagePadding(for:at:in:)Extension methodUndocumented
Declaration
Swift
func messagePadding(for message: MessageType, at indexPath: IndexPath, in messagesCollectionView: MessagesCollectionView) -> UIEdgeInsets -
cellTopLabelAlignment(for:at:in:)Extension methodUndocumented
Declaration
Swift
func cellTopLabelAlignment(for message: MessageType, at indexPath: IndexPath, in messagesCollectionView: MessagesCollectionView) -> LabelAlignment -
cellBottomLabelAlignment(for:at:in:)Extension methodUndocumented
Declaration
Swift
func cellBottomLabelAlignment(for message: MessageType, at indexPath: IndexPath, in messagesCollectionView: MessagesCollectionView) -> LabelAlignment -
widthForMedia(message:at:with:in:)Extension methodUndocumented
Declaration
Swift
func widthForMedia(message: MessageType, at indexPath: IndexPath, with maxWidth: CGFloat, in messagesCollectionView: MessagesCollectionView) -> CGFloat -
heightForMedia(message:at:with:in:)Extension methodUndocumented
Declaration
Swift
func heightForMedia(message: MessageType, at indexPath: IndexPath, with maxWidth: CGFloat, in messagesCollectionView: MessagesCollectionView) -> CGFloat -
widthForLocation(message:at:with:in:)Extension methodUndocumented
Declaration
Swift
func widthForLocation(message: MessageType, at indexPath: IndexPath, with maxWidth: CGFloat, in messagesCollectionView: MessagesCollectionView) -> CGFloat -
heightForLocation(message:at:with:in:)Extension methodUndocumented
Declaration
Swift
func heightForLocation(message: MessageType, at indexPath: IndexPath, with maxWidth: CGFloat, in messagesCollectionView: MessagesCollectionView) -> CGFloat -
shouldCacheLayoutAttributes(for:)Extension methodUndocumented
Declaration
Swift
func shouldCacheLayoutAttributes(for message: MessageType) -> Bool
MessagesLayoutDelegate Protocol Reference