Assuming I'm on a chat scenario, I want user images to move along with scroll until the other user's messages appear. Some visual example:
I'm using a subclass of UICollectionViewFlowLayout
to display the messages and provide that initial left offset for the messages (the sectionInset
property is not working on iOS 9 for some reason) and I assumed handling a custom supplementary view to do what's shown above should not be that hard, but apparently it is :)
Some info:
- I'm not using standard header/footers for flowLayout since it add a space between sections that I don't want
- Found this link which is pretty interesting from performance perspective but the example is somehow incomplete (great post though)
- I'm trying to avoid
shouldInvalidateLayoutForBoundsChange:
to returntrue
and recreate attributes every time since chat cells can be complex in terms of size calculation.
I believe this is not a weird scenario, have anyone accomplish something like this successfully? If so, I would appreciate some pointers.
Thank you in advance.