messageList.insert(contentsOf: immessages, at: 0)
messagesCollectionView.reloadDataAndKeepOffset()

when i scroll to the visible cell,it does not automatically call the function ### apply(_ layoutAttributes: UICollectionViewLayoutAttributes)
so disordered layout
-->
Hi @chunxige, can you please be more specific? Did you make some custom changes to the function? Have you tried MessageKit 1.0?
Sent with GitHawk
no ,i use MessageKit 0.13.5,i try to update to MessageKit 1.0
Are you using custom cells? What makes you think apply isn't being called? It seems to be laying out the avatar and labels
Sent with GitHawk
What kind of cell class type?
no ,i use TextMessageCell,and i print Log the in that function ,i find when i scroll from last section postion to the top postion,it dont trigger the function ,and it use the last section's attributelayout as the top attributelayout

Are you saying it never prints anything? Because we cache layouts and so scrolling through cells after they have been layed out the first time might not trigger apply. @SD10 would know if this assumption is correct or not. But as I stated earlier, it is laying out the avatar and labels so the function is being called
Sent with GitHawk

i'm setting disabeld the layout cache ,but it still happend ,and i find the solution :
https://stackoverflow.com/questions/23995544/ios-applylayoutattributes-does-not-get-called-for-some-of-the-cells
and i refer to the MessageKit 1.0 , modified the code in MessagesCollectionViewLayoutAttributes in the MessageKit 0.13.5, and it works perfectly!

So just to clarify, the issue was you were using MessageKit 0.13.5?
Sent with GitHawk
yes ,i am using MessageKit 0.13.5 now
Yeah we stopped caching in MessageKit 1.0 because it leads to unexpected behavior for the consumers of the framework. The old way of calculating equality of attributes was not good to say the least -- as you've fixed @chunxige
If you think this is resolved now, let me know and we'll close this issue 👍
yeah ,please close the issue
Most helpful comment
yeah ,please close the issue