Add FloatingPanelControllerDelegate.floatingPanel(_:shouldRecognizeSimultaneouslyWith:)

This commit is contained in:
Shin Yamamoto
2018-12-20 11:20:22 +09:00
parent 8204a6cf27
commit bc4a2def42
4 changed files with 25 additions and 1 deletions
@@ -372,6 +372,7 @@
</view>
<size key="freeformSize" width="375" height="667"/>
<connections>
<outlet property="nestedScrollView" destination="xba-kG-VQ2" id="ddV-kf-37A"/>
<outlet property="scrollView" destination="sBe-tN-uMi" id="h4S-Zl-cLO"/>
</connections>
</viewController>
@@ -198,6 +198,15 @@ class SampleListViewController: UIViewController, UITableViewDataSource, UITable
}
}
func floatingPanel(_ vc: FloatingPanelController, shouldRecognizeSimultaneouslyWith gestureRecognizer: UIGestureRecognizer) -> Bool {
switch currentMenu {
case .showNestedScrollView:
return (vc.contentViewController as? NestedScrollViewController)?.nestedScrollView.gestureRecognizers?.contains(gestureRecognizer) ?? false
default:
return false
}
}
var initialPosition: FloatingPanelPosition {
return .half
}
@@ -265,6 +274,7 @@ class ModalPanelLayout: FloatingPanelIntrinsicLayout {
class NestedScrollViewController: UIViewController {
@IBOutlet weak var scrollView: UIScrollView!
@IBOutlet weak var nestedScrollView: UIScrollView!
@IBAction func longPressed(_ sender: Any) {
print("LongPressed!")