As @pepsy said, the full screen view is not intended to be dismissed by swiping. However, if you still want to try it, here's something I started
NOTE: it's a bit glitchy the parent controller is not visible while dragging.
I added a UIPanGestureRecognizer to the view to simulate the swipe to dismiss behavior. I also have a Close (X) button, as the swipe gesture is not as intuitive as for a sheet.
@IBAction func panGestureRecognizerHandler(_ sender: UIPanGestureRecognizer) {
let translationY = sender.translation(in: sender.view!).y
switch sender.state {
case .began:
break
case .changed:
view.transform = CGAffineTransform(translationX: 0, y: translationY)
case .ended, .cancelled:
if translationY > 160 {
dismiss(animated: true, completion: nil)
} else {
UIView.animate(withDuration: 0.2, animations: {
self.view.transform = CGAffineTransform(translationX: 0, y: 0)
})
}
case .failed, .possible:
break
@unknown default:
break
}
}