|
|
|
@ -66,6 +66,10 @@ public class SheetViewController: UIViewController {
|
|
|
|
|
// Gestures
|
|
|
|
|
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(didTapBackground))
|
|
|
|
|
self.view.addGestureRecognizer(tapGesture)
|
|
|
|
|
|
|
|
|
|
let swipeDownGesture = UISwipeGestureRecognizer(target: self, action: #selector(didSwipeDown))
|
|
|
|
|
swipeDownGesture.direction = .down
|
|
|
|
|
self.view.addGestureRecognizer(swipeDownGesture)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// MARK: Present / Dismiss animations
|
|
|
|
@ -123,6 +127,12 @@ public class SheetViewController: UIViewController {
|
|
|
|
|
// inform delegate to
|
|
|
|
|
delegate?.sheetViewControllerRequestedDismiss(self)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@objc
|
|
|
|
|
func didSwipeDown() {
|
|
|
|
|
// inform delegate to
|
|
|
|
|
delegate?.sheetViewControllerRequestedDismiss(self)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extension SheetViewController: UIViewControllerTransitioningDelegate {
|
|
|
|
|