Detect when a UITextView has completed scrolling

Is there any way to detect when a UITextView has completed scrolling? As a note, I allow the user to enable or disable paging.

Thanks.

+3
source share
1 answer

UITextViewis a subclass UIScrollViewthat has a class UIScrollViewDelegatefor controlling scroll behavior. One of his methods is scrollViewDidEndDecelerating. You can configure your view controller to this protocol, set your UITextView delegateproperty to the view controller, and then implement the method scrollViewDidEndDecelerating. When the method is called, it UITextViewwill complete the scroll. eg:.

in .h:

@interface MyViewController : UIViewController <UIScrollViewDelegate>

in .m:

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
{
    NSLog(@"Finished scrolling");
}
+10
source

Source: https://habr.com/ru/post/1716268/


All Articles