Skip to content

Instantly share code, notes, and snippets.

@ronnieV3
Created October 13, 2010 19:42
Show Gist options
  • Save ronnieV3/624750 to your computer and use it in GitHub Desktop.
Save ronnieV3/624750 to your computer and use it in GitHub Desktop.
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
{
if (currentPageNumber != 4) {
NSLog(@"scrollViewDidEndDecelerating");
//find current page
currentPageNumber = (self.scrollView.contentOffset.x / 1024.0);
//set counter and load new view
counter = currentPageNumber;
NSDictionary *pageData = [self dataForPage:counter];
[nextPage initImages:[pageData objectForKey:@"mainImageName"] :[pageData objectForKey:@"mainTitleName"] :[pageData objectForKey:@"mainBodyName"]];
nextPage.frame = CGRectMake((1024.0 * counter), 0.0, 1024.0, 466.0);
[nextPage startAnimations:850];
[self sendClick:[btnArray objectAtIndex:counter]];
/////clear other view
[currentPage clearContent];
UIImageViewGlobalSupplyOverview *swapController = currentPage;
currentPage = nextPage;
nextPage = swapController;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment