Core
-
A custom collection view layout designed to present items in a grid-like format, similar to UITableView, while aligning content to either the leading or trailing edge of the UICollectionView. This layout supports chat-style interfaces by preserving a consistent content offset from the bottom. It also accommodates self-sizing cells and supplementary views, ensuring dynamic and responsive content presentation.
Custom Properties:
CollectionViewChatLayout.delegateCollectionViewChatLayout.settingsCollectionViewChatLayout.keepContentOffsetAtBottomOnBatchUpdatesCollectionViewChatLayout.processOnlyVisibleItemsOnAnimatedBatchUpdatesCollectionViewChatLayout.keepContentAtBottomOfVisibleAreaCollectionViewChatLayout.visibleBoundsCollectionViewChatLayout.layoutFrameCustom Methods:
CollectionViewChatLayout.getContentOffsetSnapshot(...)CollectionViewChatLayout.restoreContentOffset(...)CollectionViewChatLayout.reconfigureItems(...)
See moreCollectionViewChatLayout.indexPathForItePinnedAt(...)Declaration
Swift
@MainActor open class CollectionViewChatLayout : UICollectionViewLayout -
See moreCollectionViewChatLayoutdelegateDeclaration
Swift
@MainActor public protocol ChatLayoutDelegate : AnyObject -
Custom implementation of
See moreUICollectionViewLayoutAttributesDeclaration
Swift
@MainActor public final class ChatLayoutAttributes : UICollectionViewLayoutAttributes -
See moreCollectionViewChatLayoutsettings.Declaration
Swift
public struct ChatLayoutSettings : Equatable, Sendable -
Represents content offset position expressed by the specific item and it offset from the top or bottom edge.
See moreDeclaration
Swift
public struct ChatLayoutPositionSnapshot : Hashable, Sendable -
Custom implementation of
See moreUICollectionViewLayoutInvalidationContextDeclaration
Swift
@MainActor public final class ChatLayoutInvalidationContext : UICollectionViewLayoutInvalidationContext -
Type of the item supported by
See moreCollectionViewChatLayoutDeclaration
Swift
public enum ItemKind : CaseIterable, Hashable, Sendable -
Represents desired item size.
See moreDeclaration
Swift
public enum ItemSize : Hashable, Sendable -
Represent item alignment in collection view layout
See moreDeclaration
Swift
public enum ChatItemAlignment : Hashable, Sendable -
Represents pinning behavour of the element.
See moreDeclaration
Swift
public enum ChatItemPinningType : Hashable, Sendable -
Represents the point in time when
See moreCollectionViewChatLayoutasks about layout attributes modification.Declaration
Swift
public enum InitialAttributesRequestType : Hashable
Core Reference