Skip to content

Commit

Permalink
Add init argment to switch pan gesture of backdrop view (#43)
Browse files Browse the repository at this point in the history
* add enables pan gesture of backdrop view

* Update Rideau/RideauViewController.swift

* Update Rideau/RideauViewController.swift

Co-authored-by: Muukii <[email protected]>
  • Loading branch information
shima11 and muukii authored Jan 31, 2021
1 parent 5d6287a commit fc62973
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions Rideau/RideauViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ open class RideauViewController : UIViewController {
configuration: RideauView.Configuration,
initialSnapPoint: RideauSnapPoint,
resizingOption: RideauContainerView.ResizingOption,
backdropColor: UIColor = UIColor(white: 0, alpha: 0.2)
backdropColor: UIColor = UIColor(white: 0, alpha: 0.2),
usesDismissalPanGestureOnBackdropView: Bool = true
) {

precondition(configuration.snapPoints.contains(initialSnapPoint))
Expand All @@ -64,15 +65,19 @@ open class RideauViewController : UIViewController {

self.modalPresentationStyle = .overFullScreen
self.transitioningDelegate = self

do {

let pan = UIPanGestureRecognizer()

backgroundView.addGestureRecognizer(pan)

rideauView.register(other: pan)


if usesDismissalPanGestureOnBackdropView {

let pan = UIPanGestureRecognizer()

backgroundView.addGestureRecognizer(pan)

rideauView.register(other: pan)

}

}

do {
Expand Down

0 comments on commit fc62973

Please sign in to comment.