Tuesday, June 4, 2013

UIScrollView tracking example in Objective C (iOS).


UIScrollView tracking

Returns whether the user has touched the content to initiate scrolling. (read-only)

@property(nonatomic, readonly, getter=isTracking) BOOL tracking

Discussion of [UIScrollView tracking]
The value of this property is YES if the user has touched the content view but might not have yet have started dragging it.

UIScrollView tracking example.
- (void)scrollViewDidScroll:(UIScrollView *) theScrollView {
         if (theScrollView.dragging || theScrollView.tracking)
              [self.delegate scrolling:[theScrollView contentOffSet]];
}

Example of [UIScrollView tracking].
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    if(scrollView.isTracking){
        //do something
    }
}

End of UIScrollView tracking example article.