I need to know on a continuous basis when my UIScrollView is scrolling or dragging.
When you call [setContentOffset:animated:] , it's passing that off to the UIScrollView as a CABasicAnimation , manipulating the bounds property. Granted, this check will also return true if the shape of the scroll view itself is animating.
Do you know if it is possible to know if an Android Widget ScrollView can scroll? If it has enough space it doesn't need to scroll, but as soon as a dimension exceeds a maximum value the widget can scroll.
You can scroll the scrollview in the Storyboard / Interface builder! Select the view inside scrollview in Document Outline, then scroll using your mouse or trackpad, you can see the view move.
The scroll view displays its content within the scrollable content region. As the user performs platform-appropriate scroll gestures, the scroll view adjusts what portion of the underlying content is visible. ScrollView can scroll horizontally, vertically, or both, but does not provide zooming functionality.
Implement these two delegate methods..
- (void)scrollViewDidScroll:(UIScrollView *)sender{
//executes when you scroll the scrollView
}
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
// execute when you drag the scrollView
}
Better use isTracking
to detect if the user initiated a touch-drag.
func scrollViewDidScroll(_ scrollView: UIScrollView) {
if scrollView.isTracking {
// ...
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With