I have a similar UI to yours, It's an infinite auto-scrolling collection view using compositional layout. You could check My Demo Project for reference.
When you use Compositional Layout to set up collection view, scrollViewDidScroll(_:)
and scrollViewDidEndDecelerating(_:)
won't be fired. So we need to use
layout.visibleItemsInvalidationHandler = {
visibleItems, point, environment in
// Config auto scroll here
}
And remember to invalidate timer when user tap the collection view cell. Please see detailed code in the above link.
Hope this help :)
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.