Vinodh-G / VSCollectionKit

VSCollectionKit is handy framework supporting funtionality of a UICollectionView or UICollectionViewController with much easier than way we work with UICollectionView, and avoiding a lot of collectionView related code hazzles and duplicates.
67 stars 6 forks source link

[Stories][Feature Ask] Prefetch CollectionViewCells on VSCollectionViewController #2

Closed Vinodh-G closed 1 year ago

Vinodh-G commented 1 year ago

Ask for VSCollectionViewController to support for prefetching the collection views cells when scrolling the collection view.

Purpose We all know how power full is collection view, and how reusable, independent the components are with VSCollectionKit. The purpose the prefetch ask is, for achieving infinite scrolling for some of or use cases like long message scrolling, long comments. scrolling, long Instagram posts scrolling, the prefetch of the collection view cells would give user an experience like he is scrolling the content seamlessly with out showing the loader. Pre loading any content displayed in the collectionview before reaching the end of scrolling.

Goal

Timeline Expected in release 1.4

Review

Vinodh-G commented 1 year ago

VSCollectionViewController introduced with 2 new closure properties

public typealias PreFetchDidTrigger = (_ indexPaths: [IndexPath]) -> Void
public typealias PreFetchDidCancel = (_ indexPaths: [IndexPath]) -> Void
open var **preFetchDidTrigger**: PreFetchDidTrigger?
open var **preFetchDidCancel**: PreFetchDidCancel?

Any subclass of VSCollectionViewController can optionally set these properties to get informed about the prefetch loading cells triggered or triggered cancelled.

This way we can handle pre loading any content displayed in the collectionview before reaching the end of scrolling.

The Sample App with target InfiniteMessageScrolling on the main project will be able to demonstrate the usage of the above apis and experience the seamless of infinite scrolling.

<p float="left", align="center">

Vinodh-G commented 1 year ago

Feature part of release 1.4