There’s a WWDC video from 2011 : “Advanced ScrollView Techniques” which explains one way to do infinite scrolling. Look at 18:08 if it is what you want.
On 07/10/2013, at 13:21, Dave <d...@looktowindward.com> wrote: > Hi, > > I'd like to be able to Scroll Infinitely in a Scroll, e.g. when the scrolling > is past the last item in the Scroll start displaying the first and when > scrolling before the first item, starting displaying the last. The items in > this case are UIImageViews and they have a fixed height and a variable width > and no one image will be wider that the Scroll View itself. Also it needs to > work with pagingEnables = NO, e.g. there will be more than one Image visible. > > I've playing around a bit and found a some sample code that sort of does it > but it doesn't handle the wrapping the Images smoothly (is was written to > have paging enabled). > > My plan was/is to detect when the scrolling had hit before the first/after > the last and to move the first Subview to the End or the Last one to the > beginning, depending on the direction of movement, but at the moment, I can't > seem to see a way of detecting these conditions. > > I logged contentOffset and contentSize in the scrollViewDidScroll delegate > method and got these results: > > > scrollViewDidScroll Offset: {4017, 0} - Size: {5119, 200} > scrollViewDidScroll Offset: {4061, 0} - Size: {5119, 200} > scrollViewDidScroll Offset: {4095, 0} - Size: {5119, 200} > > When hitting the end and > > scrollViewDidScroll Top Scroll View Offset: {106, 0} - Size: {5119, 200} > scrollViewDidScroll Top Scroll View Offset: {24, 0} - Size: {5119, 200} > scrollViewDidScroll Top Scroll View Offset: {-0, 0} - Size: {5119, 200} > > When hitting the start. > > I'm not sure how if I can detect the start/end conditions using these values? > > Any points on the best way to implement this would greatly appreciated! > > All the Best > Dave > > _______________________________________________ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/cocoa-dev/marcelo.alves%40me.com > > This email sent to marcelo.al...@me.com _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com