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

Missing pan gestures (edit: in UIPageViewController) #172

Closed
1 of 3 tasks
GerdC opened this issue Mar 24, 2019 · 2 comments · Fixed by #191
Closed
1 of 3 tasks

Missing pan gestures (edit: in UIPageViewController) #172

GerdC opened this issue Mar 24, 2019 · 2 comments · Fixed by #191
Projects

Comments

@GerdC
Copy link

GerdC commented Mar 24, 2019

Please fill out this template appropriately when filing a bug report.

Please remove this line and everything above it before submitting.

Short description

no pan gestures call methods floatingPanelDidMove and floatingPanelWillBeginDragging when not in state .full

Expected behavior

when panning, calls to the delegate methods floatingPanelDidMove, floatingPanelWillBeginDragging and floatingPanelDidEndDragging are expected, the floatig panel should move visually.

Actual behavior

The expected behaviour happens only in state .full.

in state .half and .pin, only floatingPanelDidEndDragging is called, the FloatingPanelController does not move.

Steps to reproduce

I have a tabBarViewController containing a UIViewController.
This UIViewController calls fpc.addPanel(toParent: self, animated: true)
The contentViewController is a tableViewController.

The visual size does not matter: Using
public func insetFor(position: FloatingPanelPosition) -> CGFloat? {
switch position {
case .full: return 16.0
case .half: return 702.0
default: return nil
}
}
.half is almost as long as .full, is doesn't make a difference.

The mntioned delegate methods floatingPanelDidMove, floatingPanelWillBeginDragging and floatingPanelDidEndDragging have no implementation apart from printing debug lines to the console.

Code example that reproduces the issue

Environment

Library version
FloatingPanel (1.4.0)
Installation method

  • CocoaPods
  • Carthage
  • Git submodules

iOS version(s)
12.1

Xcode version
10.1

@GerdC
Copy link
Author

GerdC commented Mar 25, 2019

Found the solution:

The viewController that shows the FloatingPanelController must not be a page of a pageViewController. (it was the only page)

You might add this as a precondition.

@GerdC GerdC changed the title Missing pan gestures Missing pan gestures (edit: in UIPageViewController) Mar 25, 2019
@scenee scenee added this to To do in v1.x Mar 27, 2019
@scenee
Copy link
Owner

scenee commented Mar 30, 2019

@GerdC
I confirmed this issue is resolved by FloatingPanelControllerDelegate.floatingPanel(_:shouldRecognizeSimultaneouslyWith:)

Here is a sample code 👍

let page1 = FloatingPanelController(delegate: self)
page1.view.backgroundColor = .blue
page1.show()
...

func floatingPanel(_ vc: FloatingPanelController, shouldRecognizeSimultaneouslyWith gestureRecognizer: UIGestureRecognizer) -> Bool {
    return true
}

@scenee scenee moved this from To do to In progress in v1.x Apr 2, 2019
v1.x automation moved this from In progress to Done Apr 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
v1.x
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants