In the end I hacked the whole thing by placing a Pan Gesture on UITextView. This way all functionalities of editing text view were preserved and scrolling was disabled.
When I wanted to disable scrolling of text view, I didn't set scrollEnabled = NO
. Instead I added Pan Gesture recognizer on UITextView. When I wanted to enable scrolling, I just removed that same Pan Gesture recognizer from text view.
Like this:
init method...
_scrollDisablerGR = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(textViewScrollAction:)];
// method textViewScrollAction does nothing, empty implementation
[_textView addGestureRecognizer:_scrollDisablerGR];
somewhere else in code:
if (shouldEnableScrolling) {
[self.textView removeGestureRecognizer:_scrollDisablerGR];
} else {
if (!_scrollDisablerGR.view) {
[self.textView addGestureRecognizer:_scrollDisablerGR];
}
}
Works great ;)