ImageSlideshow
ImageSlideshow copied to clipboard
Swipe Gesture
When I try to add a swipe gesture to the fullscreen view nothing happens. I am wondering what the top view is because I have tried adding the gesture to the FullScreenSlideshowViewController.
Also can you add dismiss fullscreenviewcontroller by swiping (from bottom to top) and (from top to bottom)
You can add swipe to dismiss feature this way add this in your project
extension FullScreenSlideshowViewController {
func addSwipeDownGesture() {
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
let swipeDownGesture = UISwipeGestureRecognizer(target: self, action: #selector(self.swipeDownFullScreenControllerGestureRecognizer))
swipeDownGesture.direction = .down
self.view.addGestureRecognizer(swipeDownGesture)
}
}
@objc func swipeDownFullScreenControllerGestureRecognizer() {
self.dismiss(animated: true, completion: nil)
}
}