Avatar
Kishikawa Katsumi 1/30/2020 6:07 AM
続きがあって previewViewContainer.panGesture(failForSwipe: false, delegate: self) .sink { [weak self] (gesture) in guard let self = self else { return } switch gesture.state { case .began: ... case .changed: ... if delta > 40 && velocity.y > 300 { // quick swipe print("swipe down dismiss") previewSwipeDismiss = .down } else if previewView.frame.minY < -self.view.bounds.height*0.25 { print("swipe up dismiss") previewSwipeDismiss = .up } else { previewSwipeDismiss = .none }