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) -> CGSize
Parameters
section
The section number of the header.
messagesCollectionView
The
MessagesCollectionView
in 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) -> CGSize
Parameters
section
The section number of the footer.
messagesCollectionView
The
MessagesCollectionView
in 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) -> 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 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) -> 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 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) -> 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.
-
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