Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When reusing a panel that tracks a scrollView, the panel stays the scrollView's delegate #113

Closed
datwelk opened this issue Jan 21, 2019 · 0 comments

Comments

@datwelk
Copy link
Contributor

datwelk commented Jan 21, 2019

When changing contentViewController on a FloatingPanel that has been set up to track a scrollView, that scrollView's delegate is not properly restored to the original delegate floatingPanel.userScrollViewDelegate, resulting in a crash when reusing it.

How to reproduce:

  • create a floating panel with content view controller A that has a scroll view alpha with a delegate X (could be viewcontroller A)
  • present the panel
  • set the floating panel's content view controller to a view controller B with scroll view beta and a delegate Y (could be viewcontroller B)
  • set the floating panel's content view controller back to view controller A
  • note that the delegate of scroll view alpha is a FloatingPanel instance, instead of the original delegate X

Because FloatingPanel does not conform to UIScrollViewDelegate, whenever a delegate method is fired, the app will crash with an unrecognized selector sent to instance error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant