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

Restore original scroll view delegate when updating content VC #114

Merged
merged 1 commit into from Jan 28, 2019

Conversation

datwelk
Copy link
Contributor

@datwelk datwelk commented Jan 21, 2019

Fixes #113

Test this as follows:

  • 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 still X. Without this PR, the delegate is a FloatingPanel instance, instead of the original delegate X.

@scenee
Copy link
Owner

scenee commented Jan 24, 2019

Thank you for your PR! I will try to test and understand this issue.

@datwelk
Copy link
Contributor Author

datwelk commented Jan 24, 2019

Updated my comment with some more details, also in the original issue #113, let me know if anything is unclear.

@scenee
Copy link
Owner

scenee commented Jan 26, 2019

I got it! Oh yeah, the library doesn't care of #113. Thanks again. I appreciate it.

Then, I'd like you to modify your PR a bit. A scroll view tracking by FloatingPanelController can be one not managed by a content view controller according to the API design. Therefore it's better to add the following condition 😄

            if let scrollView = floatingPanel.scrollView,
                let delegate = floatingPanel.userScrollViewDelegate,
+                vc.view.subviews.contains(scrollView) {

@datwelk datwelk force-pushed the hotfix/restore-scroll-view-delegate branch from 6e4d36a to 49e868a Compare January 26, 2019 11:41
@datwelk
Copy link
Contributor Author

datwelk commented Jan 26, 2019

Good point @scenee, I have now updated the PR to address this concern.

@scenee scenee merged commit 6e4e9df into scenee:master Jan 28, 2019
@scenee
Copy link
Owner

scenee commented Jan 28, 2019

Thanks a lot!

dscyrescotti pushed a commit to dscyrescotti/FloatingPanel that referenced this pull request Jun 16, 2022
…-delegate

Restore original scroll view delegate when updating content VC
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

Successfully merging this pull request may close these issues.

None yet

2 participants