FloatingPanel icon indicating copy to clipboard operation
FloatingPanel copied to clipboard

ScrollView tracking issues when using UIViewControllerPreviewingDelegate

Open Dominik777 opened this issue 6 years ago • 1 comments

Short description

When the content view controller e.g UITableViewController supports UIViewControllerPreviewingDelegate (3D Touch) the scroll tracking starts behaving weirdly.

Expected behavior

That the floating panel behaves as normal if UIViewControllerPreviewingDelegate is used

Actual behavior

The floating panel scroll view tracking behaviour stops working or becomes very jumpy and its very hard to close the menu.

Steps to reproduce

Add a UITableViewController as the floating panel content view controller. Enable scroll view tracking. Enable UIViewControllerPreviewingDelegate when cells are touched. Once registerForPreviewing(with: self, sourceView: tableView) is triggered the floating panel scroll tracking starts breaking. Code example that reproduces the issue

Environment

Swift 5 Library version 1.5.0 Installation method

  • [ ] CocoaPods
  • [ ] Carthage
  • [ ] Git submodules

iOS version(s)

Xcode version Xcode 10.2

Dominik777 avatar Apr 11 '19 08:04 Dominik777

Hey, I had to change my ViewController to be a regular UIViewController with a table view outlet. Than you can register the delegate to the view and not the table view. registerForPreviewing(with: self, sourceView: view) which will not break the panel scroll view tracking. I am not sure this can be achieved with a UITableViewController as self.view is the table view which causes the conflicts.

I also tried playing around with previewingGestureRecognizerForFailureRelationship to see if I can make it work with UITableViewControllers, but had no luck. If you have any ideas please let me know. Thanks for your great library. Best regards

Dominik777 avatar Apr 11 '19 10:04 Dominik777