ContainerCollectionViewCellDelegate
public protocol ContainerCollectionViewCellDelegate : AnyObject
A delegate of ContainerCollectionViewCell/ContainerCollectionReusableView should implement this methods if
it is required to participate in containers lifecycle.
-
prepareForReuse()Default implementationPerform any clean up necessary to prepare the view for use again.
Default Implementation
Default implementation does nothing.
Declaration
Swift
func prepareForReuse() -
preferredLayoutAttributesFitting(_:Default implementation) Allows to override the call of
ContainerCollectionViewCell/ContainerCollectionReusableViewUICollectionReusableView.preferredLayoutAttributesFitting(...)and make the layout calculations.NB: You must override it to avoid unnecessary autolayout calculations if you are providing exact cell size in
ChatLayoutDelegate.sizeForItem(...)and returnlayoutAttributeswithout modifications.Default Implementation
Default implementation returns:
nil.Declaration
Swift
func preferredLayoutAttributesFitting(_ layoutAttributes: ChatLayoutAttributes) -> ChatLayoutAttributes?Parameters
layoutAttributesChatLayoutAttributesprovided byCollectionViewChatLayoutReturn Value
Modified
ChatLayoutAttributeson nil ifUICollectionReusableView.preferredLayoutAttributesFitting(...)should be called instead. -
modifyPreferredLayoutAttributesFitting(_:Default implementation) Allows to additionally modify
ChatLayoutAttributesafter theUICollectionReusableView.preferredLayoutAttributesFitting(...)call.Default Implementation
Default implementation does nothing.
Declaration
Swift
func modifyPreferredLayoutAttributesFitting(_ layoutAttributes: ChatLayoutAttributes)Parameters
layoutAttributesChatLayoutAttributesprovided byCollectionViewChatLayout.Return Value
Modified
ChatLayoutAttributes -
apply(_:Default implementation) Apply the specified layout attributes to the view. Keep in mind that this method can be called multiple times.
Default Implementation
Default implementation does nothing.
Declaration
Swift
func apply(_ layoutAttributes: ChatLayoutAttributes)Parameters
layoutAttributesChatLayoutAttributesprovided byCollectionViewChatLayout.