简体   繁体   中英

Swift - Paging with CoreData and CollectionView

What is the correct way to implement paging in a CollectionView with CoreData?

I have thought of 2 methods.

The first involves showing a defined amount of objects, increasing it when the user moves to the top of the CollectionView and finally reloading the data.

The second would be to manipulate the size of the cells to assign a value of 0 to all those that I do not want to show until the user moves to the top, once this is done, reload those cells to assign them their debit size and make them visible.

Is any of these a good practice or is there a better one?

For what I understand, you're using load more cells when the user scrolls to the top?

If it is what I understand, you could customize the collection view layout to add cells from bottom to top. I have built a load-more collection when the user scrolls to the top here: https://www.dropbox.com/s/0ccd34cn05b01ua/ReversedCollection.mov?dl=0

An example can be found here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM