I have to update text of a label every time I scroll the UIScrollView...or everytime I scroll and leave it stop at a point on it's own. This updation of the text of the label is done based on the contentoffset of the scrollview. So now I am putting checks in each method :
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{
int one = scrollView.contentOffset.x/21;
int two = (21*one)+14;
CGPoint point = CGPointMake(two, scrollView.contentOffset.y);
[scrollView setContentOffset:point animated:YES];
[self setLabelText:@"scroll"];
}
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate{
int one = scrollView.contentOffset.x/21;
int two = (21*one)+14;
CGPoint point = CGPointMake(two, scrollView.contentOffset.y);
[scrollView setContentOffset:point animated:YES];
[self setLabelText:@"scroll"];
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView{
CGPoint offset = scrollView.contentOffset;
if (offset.x < minuteScrollMinX) offset.x = minuteScrollMinX;
if (offset.x > minuteScrollMaxX) offset.x = minuteScrollMaxX;
scrollView.contentOffset = offset;
}
Now after this, my scrollview becomes too jerky, how can I prevent this jerky scrolling of the scrollview? Is there a common delegate instead of these three methods or even the top two methods? Thanks in advance for any help.