ImageSlideshow icon indicating copy to clipboard operation
ImageSlideshow copied to clipboard

Swipe Gesture

Open coder123-star opened this issue 4 years ago • 2 comments

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.

coder123-star avatar Nov 04 '20 01:11 coder123-star

Also can you add dismiss fullscreenviewcontroller by swiping (from bottom to top) and (from top to bottom)

Tisobyn avatar Dec 09 '20 05:12 Tisobyn

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)
    }
    
}

Hardip-Unikwork avatar Mar 31 '22 07:03 Hardip-Unikwork