IAInfiniteGridView
IAInfiniteGridView copied to clipboard
Scrolling to gridViewIndex with animation
There is a method (jumpToIndex) to go directly to a page Index but without scrolling animation. How to have this same method with scrolling animation ?
This is still a problem for me to implement. Scrolling to offset using setContentOffset doesn't fire scrollDidView hence the grids' creation didn't work properly
I've found an alternative, if you use a tapGestureRecognizer with a separate method and call the setContentOffset within that, it seems to work properly (at least for my usage of it).
-(void) headerTapped:(id) sender {
//get the point that was tapped within the context of the topScrollView (not the wrapper)
CGPoint newPoint = [sender locationInView:self];
UIView *result = [self gridViewAtPoint:newPoint];
if (self.gridDelegate && [self.gridDelegate respondsToSelector:@selector(infiniteGridView:didSelectGridAtIndex:)]) {
[self setContentOffset:CGPointMake(result.frame.origin.x, 0) animated:YES];
[self.gridDelegate infiniteGridView:self didSelectGridAtIndex:result.tag];
}
}