diff --git a/Framework/Sources/FloatingPanel.swift b/Framework/Sources/FloatingPanel.swift index de23e9e..8910626 100644 --- a/Framework/Sources/FloatingPanel.swift +++ b/Framework/Sources/FloatingPanel.swift @@ -35,7 +35,7 @@ class FloatingPanel: NSObject, UIGestureRecognizerDelegate, UIScrollViewDelegate return remains.count == 0 } - let panGesture: FloatingPanelPanGestureRecognizer + let panGestureRecognizer: FloatingPanelPanGestureRecognizer var isRemovalInteractionEnabled: Bool = false private var animator: UIViewPropertyAnimator? @@ -68,17 +68,17 @@ class FloatingPanel: NSObject, UIGestureRecognizerDelegate, UIScrollViewDelegate layout: layout) self.behavior = behavior - panGesture = FloatingPanelPanGestureRecognizer() + panGestureRecognizer = FloatingPanelPanGestureRecognizer() if #available(iOS 11.0, *) { - panGesture.name = "FloatingPanelSurface" + panGestureRecognizer.name = "FloatingPanelSurface" } super.init() - surfaceView.addGestureRecognizer(panGesture) - panGesture.addTarget(self, action: #selector(handle(panGesture:))) - panGesture.delegate = self + surfaceView.addGestureRecognizer(panGestureRecognizer) + panGestureRecognizer.addTarget(self, action: #selector(handle(panGesture:))) + panGestureRecognizer.delegate = self } func move(to: FloatingPanelPosition, animated: Bool, completion: (() -> Void)? = nil) { @@ -146,7 +146,7 @@ class FloatingPanel: NSObject, UIGestureRecognizerDelegate, UIScrollViewDelegate public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool { - guard gestureRecognizer == panGesture else { return false } + guard gestureRecognizer == panGestureRecognizer else { return false } /* log.debug("shouldRecognizeSimultaneouslyWith", otherGestureRecognizer) */ @@ -160,13 +160,13 @@ class FloatingPanel: NSObject, UIGestureRecognizerDelegate, UIScrollViewDelegate } public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldBeRequiredToFailBy otherGestureRecognizer: UIGestureRecognizer) -> Bool { - guard gestureRecognizer == panGesture else { return false } + guard gestureRecognizer == panGestureRecognizer else { return false } /* log.debug("shouldBeRequiredToFailBy", otherGestureRecognizer) */ return false } public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRequireFailureOf otherGestureRecognizer: UIGestureRecognizer) -> Bool { - guard gestureRecognizer == panGesture else { return false } + guard gestureRecognizer == panGestureRecognizer else { return false } /* log.debug("shouldRequireFailureOf", otherGestureRecognizer) */ @@ -265,7 +265,7 @@ class FloatingPanel: NSObject, UIGestureRecognizerDelegate, UIScrollViewDelegate unlockScrollView() } } - case panGesture: + case panGestureRecognizer: let translation = panGesture.translation(in: panGesture.view!.superview) let location = panGesture.location(in: panGesture.view) diff --git a/Framework/Sources/FloatingPanelController.swift b/Framework/Sources/FloatingPanelController.swift index 470fd90..a4a9b9a 100644 --- a/Framework/Sources/FloatingPanelController.swift +++ b/Framework/Sources/FloatingPanelController.swift @@ -93,7 +93,7 @@ public class FloatingPanelController: UIViewController, UIScrollViewDelegate, UI // The underlying gesture recognizer for pan gestures public var panGestureRecognizer: UIPanGestureRecognizer { - return floatingPanel.panGesture + return floatingPanel.panGestureRecognizer } /// The current position of the floating panel controller's contents. diff --git a/README.md b/README.md index 82f42c7..f434bbf 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ self.present(fpc, animated: true, completion: nil) You can show a floating panel over UINavigationController from the containnee view controllers as a modality of `.overCurrentContext` style. -NOTE: FloatingPanelController has the custom presentation controller. If you would like to customize the presentation/dismissal, please see [FloatingPanelTransitioning](https://github.com/SCENEE/FloatingPanel/blob/feat-modality/Framework/Sources/FloatingPanelTransitioning.swift). +NOTE: FloatingPanelController has the custom presentation controller. If you would like to customize the presentation/dismissal, please see [FloatingPanelTransitioning](https://github.com/SCENEE/FloatingPanel/blob/master/Framework/Sources/FloatingPanelTransitioning.swift). ## View hierarchy