iOS Infinite Scrolling

Stephen Zaharuk / Monday, May 6, 2013

For the 13.1 release of our NUCLiOS product we added a LOT of features.  So many in fact that its actually quite easy to overlook some of them. So, today i'm going to talk about one of my favorite features added to the IGGridView: Infinite Scrolling

If you've ever seen/used the HBO GO app for the iPad, you should already have a pretty good idea of what i'm talking about. Basically its the concept of having a scrolling list, either vertical, horizontal or both, where you keep scrolling but never hit an end b/c it seamlessly wraps the data.

It's actually such a popular concept that Apple even has sample for developers. However their sample is quite simple, just 2 labels being repeated, and requires quite a bit of code. 

So, when we decided to add this feature, we made sure to make it as easy possible. In fact, its actually only one property that you have to set:

_gridView.infiniteScrolling = IGGridViewInfiniteScrollingVertical;

You actually have 4 options:

  • IGGridViewInfiniteScrollingNone (DEFAULT)
  • IGGridViewInfiniteScrollingVertical 
  • IGGridViewInfiniteScrollingHorizontal
  • IGGridViewInfiniteScrollingBoth

There are a few rules though:

  • The reordering of cells, rows and columns is not allowed while the feature is enabled.
  • You can still add, insert and delete rows cells and columns, however you can't animate them.
  • All columns must have a fixed size for horizontal infinite scrolling
  • In order for infinite scrolling to work in a specific direction, the total width/height or both must be 1.5 times the viewport size. For example, an IGGridView with the size of 100px by 200px, would need a total column width equal to or greater than 150px, and the total of all row heights equal to or greater than 300px, for both vertical and horizontal infinite scrolling.

I'm sure you'd like a chance to play around with this awesome feature. 

So i've updated the sample i used in the Netflix style grid post.

You can grab that here.

If you haven't gotten a copy of NUCLiOS 13.1, make sure to at least grab the Free Trial so that you can see for yourself how powerful and easy it is to add this feature to your own project. 

Also you can take a look at ALL of the features of our controls including Infinite scrolling in our free samples browser which is in the App Store: 

By Stephen Zaharuk (SteveZ)