pronebird / UIScrollView-InfiniteScroll

UIScrollView ∞ scroll category
MIT License
1.06k stars 148 forks source link

Add support for infinite scroll in horizontal scroll views #71

Closed Boerworz closed 6 years ago

Boerworz commented 6 years ago

Thanks for this small, very useful library!

As requested by #48, this pull request adds support for infinite scroll in horizontal scroll views (read: collection views).

Horizontal infinite scroll is enabled by specifying infiniteScrollDirection = ISCScrollDirectionHorizontal on the scroll view (and adjusting the scroll views scrolling direction accordingly). By default the direction is set to ISCScrollDirectionVertical.

To implement this behaviour I basically went through the InfiniteScroll category top-to-bottom and introduced a branch wherever the code had previously assumed that the scroll view was scrolling vertically. In other words it's a very naive/simple implementation 🙂

We've been using our fork (with the implemented behaviour) for over four months and haven't run into any issues.

pronebird commented 6 years ago

Hi @Boerworz,

Thanks for submitting this PR. Your approach looks right, so does the code. I'll merge and release it on CocoaPods over next couple of days.

Cheers, Andrej

tarek903 commented 6 years ago

i've tested for the last week it works with no problem

pronebird commented 6 years ago

Thanks @Boerworz for your efforts!

I merged your PR via https://github.com/pronebird/UIScrollView-InfiniteScroll/commit/650f9bafa9f967189a4aff759a64dee82ead4373 and released 1.1.0.

I only did a minor clean up and renamed ISCScrollDirection to InfiniteScrollDirection since I never used prefixes in the public interface of this pod.

Boerworz commented 6 years ago

Great! Thanks for merging it! 🚀