Disable interactions for scroll indicator of UITableView

Is there any way to disable interactions for scroll indicator of UITableView?


I need to keep vertical scroll indicator visible, but make it transparent for touches.

I've tried to set isUserInteractionsEnabled to false for all subviews of UITableView inside awakeFromNib (I've checked, both indicators are there as subviews), but no success, anyway I can touch and drag indicators.

Replies

I would try to use scrollViewWillBeginDragging(_:)

and reset the content offset in it.


Declaration

optional func scrollViewWillBeginDragging(_ scrollView: UIScrollView)

Parameters

scrollView

The scroll-view object that is about to scroll the content view.

See details:

https://stackoverflow.com/questions/2543670/finding-the-direction-of-scrolling-in-a-uiscrollview

Not sure I understand how resetting contentOffset will help (especially I use it for different calculations). I need all usual behavior, just disable user interactions for scroll indicators while indicators still visible and work/animates as usual.