Did you check the StreetScroller sample? https://developer.apple.com/library/ios/samplecode/StreetScroller/Introduction/Intro.html#//apple_ref/doc/uid/DTS40011102 it is the same code that was demonstrated in the WWDC 2011 I told you before.
-- :: marcelo.alves > On 08/10/2013, at 17:30, Dave <d...@looktowindward.com> wrote: > > Hi, > > Spoke too soon! > > I just can't seem to get my head around this. I can make it work, but I'm > getting into an infinite loop because updating the scroll view is causing the > delegates to fire again (AFAICT). I'm not sure what to put in layoutSubviews > and what to put in the delegate methods. I'm beginning to think this just > isn't possible with UIScrollView and wondering if I should burn a DTS Support > Request on it. > > This would be so easy if I just had the source to UIScrollView! > > All the Best > Dave > >> On 8 Oct 2013, at 20:20, Dave <d...@looktowindward.com> wrote: >> >> Hi, >> >> I finally managed to get back on this! I've got it working when scrolling >> from left to right and can detect when the user scrolls past the last item, >> however, I can't seem to find a way to detect when the user scrolls to >> before the first item. >> >> I get -0 for offset X >> >> 2013-10-08 20:18:20.607 LTWScrollTest1[17988:a0b] contentOffset : {-0, 0} >> >> But that doesn't do me much good! >> >> It seems to work quite nicely going left to right, but having difficulties >> figuring out how to make it work scrolling right to left. >> >> >> Any idea greatly appreciated as I'm need to get this working for tomorrow >> morning! >> >> Thanks a lot. >> >> All the Best >> Dave >> >> >> >> On 8 Oct 2013, at 08:56, Kyle Sluder <k...@ksluder.com> wrote: >> >>>> On Oct 8, 2013, at 12:44 AM, Dave <d...@looktowindward.com> wrote: >>>> >>>> Thanks Kyle, >>>> >>>> That's what I was trying to figure out, whether I needed to re-layout the >>>> views based on the positions or whether I could just do it by keeping an >>>> Array of the image views separately and rotating this as it scroll past >>>> the end. I sort of got this working, but of course the Subviews of the >>>> Scroll View just grows and grows! >>>> >>>> This is what I got at the moment: >>>> >>>> // Scroll past last item detected (in the scrollViewDidScroll delegate >>>> method) >>>> >>>> if (theScrollView.contentSize.width - theScrollView.contentOffset.x <= >>>> 1024) >>>> { >>>> myContentInfo = [self.pContentArray objectAtIndex:0]; >>>> [self.pContentArray addObject:myContentInfo]; >>>> [self.pContentArray removeObjectAtIndex:0]; >>>> >>>> [self addContentInfo:myContentInfo withEndFlag:YES]; >>>> } >>>> >>>> Which kind of works, but obviously isn't the way to do it. >>>> >>>> Thanks for confirming I needed to use -layoutSubviews, I'm about to start >>>> on this track now. >>> >>> You don’t *have* to use -layoutSubviews, but you'll probably get the best >>> results if you do. You could theoretically do this all in the delegate's >>> implementation of -scrollViewDidScroll:, but that’ll probably double the >>> number of layout passes and certainly multiply the number of message sends. >>> When scrolling, you want to avoid as much unnecessary work as is reasonable. >>> >>> It’s kind of a bummer that you’re going to need to split your logic up >>> between the scroll view and its delegate, thus tightly coupling the two. I >>> wish the frameworks exposed many more of their delegate hooks as subclass >>> hooks as well. Scroll views seem to stir this desire particularly >>> frequently. >>> >>> --Kyle Sluder >> >> >> _______________________________________________ >> >> 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/dave%40looktowindward.com >> >> This email sent to d...@looktowindward.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/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