twitter / TwitterTextEditor

A standalone, flexible API that provides a full-featured rich text editor for iOS applications.
Apache License 2.0
2.97k stars 161 forks source link

UIScrollViewDelegates not called as expected #19

Closed wcrtr closed 3 years ago

wcrtr commented 3 years ago

Only certain start/end delegate methods of UIScrollViewDelegate are called.

Digging into the code it seems like these should be getting triggered. It's possible I'm not setting this up right but it's confusing as I'm definitely getting a couple of the delegates firing (see details below). I've set a breakpoint on line 88 of TextViewDelegateForwarder and only the below selectors are fired.

Steps to reproduce the behavior

  1. Conform a view controller that has TextEditorView as a subView to UIScrollViewDelegate.
  2. Implement UIScrollViewDelegate methods scrollViewWillBeginDragging, scrollViewDidEndDecelerating and scrollViewDidScroll.
  3. Assign TextEditorView's textView delegate to the conforming View Controller e.g. textEditorView.scrollView.delegate = self
  4. Test app and note that scrollViewWillBeginDragging and scrollViewDidEndDecelerating fire, but scrollViewDidScroll does not.

Expected behavior

When assigning the scroll view delegate, all UIScrollViewDelegate methods are called.

Actual behavior

Only scrollViewWillBeginDragging and scrollViewDidEndDecelerating fire.

Environment

niw commented 3 years ago

@wcrtr Thank you for reporting, I confirmed the behavior, will work on it.

niw commented 3 years ago

@wcrtr The issue should be fixed on the latest master, if you can text it, that would be nice.

wcrtr commented 3 years ago

Just pulled master - working great thanks!

niw commented 3 years ago

@wcrtr Thank you for confirmation. Released version 1.1.2.