ekazaev / ChatLayout

ChatLayout is an alternative solution to MessageKit. It uses custom UICollectionViewLayout to provide you full control over the presentation as well as all the tools available in UICollectionView. It supports dynamic cells and supplementary view sizes.
MIT License
896 stars 67 forks source link

Implement pinned (sticky) header and footer #80

Open heoblitz opened 1 month ago

heoblitz commented 1 month ago

What is this PR for?

This PR introduces support for pinned (sticky) headers and footers. The implementation allows headers and footers to stay visible within the collection view's bounds.

The changes will not impact existing ChatLayout users who do not utilize the pinned feature.

Related PR: https://github.com/airbnb/MagazineLayout/pull/52

Tests

test project: ChatLayoutPinTest.zip

1. Scroll

https://github.com/user-attachments/assets/0e8333e0-f74c-4efb-b815-f5ff4a570710

2. Scroll with contentInsets

https://github.com/user-attachments/assets/3c149bc2-8f3e-4cb5-8828-9b6bb10916e6

3. Dynamic cell height

https://github.com/user-attachments/assets/83a620eb-e884-40dd-b662-45e9ea977594

ekazaev commented 1 month ago

@heoblitz Amazing job. Ill have a proper look and merge. Thank you.

ekazaev commented 1 week ago

@heoblitz Sorry, I was on my vacation. Got back. Will have a proper look and merge.

heoblitz commented 1 week ago

@ekazaev Hope you had a great vacation! Please feel free to review it at your convenience. Thank you.