Quantcast
Channel: Issue while inserting items in zero th index on UICollectionViewController with inputAccessoryView - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Issue while inserting items in zero th index on UICollectionViewController with inputAccessoryView

$
0
0

I am developing a chat conversation UI using UICollectionViewController, initially having 20 items in collectionViewController.

When I did scroll to top.

if scrollView.contentOffset.y == - 44 { /* Inserting 10 items at zero th position in collectionView */ }

I will insert 10 items at IndexPath(item: 0, section: 0)

So will have a total of 30 items in CollectionView.

At this time I got some UI animation issue and collection view was scrolled to top.

e.g actual items are 0,1,2,3...19

now I am inserting at zeroth index so items like 29,28,27,...20,0,1,2,3...19

I hope you understand.

example gif

my issue is when my collection view is showing 0,1,2,3 at top I am inserting 29,28,27,...20 but collection view won't scroll to up or down. It has to show same 0,1,2,3 like (silently insert items at top and don't change any ui)

Like WhatsApp chat - fetching old messages while scrolling to top.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images