From 380d7e74e49c47c6be039f784ad0cdfb9f7491ad Mon Sep 17 00:00:00 2001 From: Jack Rouleau Date: Mon, 23 Oct 2017 13:18:35 -0400 Subject: [PATCH] Made the swipe up and down gestures work even when not presenting modally --- MediaBrowser.podspec | 2 +- MediaBrowser/MediaBrowser.swift | 33 +++++++++++++++------------------ 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/MediaBrowser.podspec b/MediaBrowser.podspec index b63cdf1..4a86c7f 100644 --- a/MediaBrowser.podspec +++ b/MediaBrowser.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'MediaBrowser' - s.version = '1.0.2' + s.version = '1.0.4' s.summary = 'A simple iOS photo and video browser with optional grid view, captions and selections written in Swift3.' s.description = <<-DESCRIPTION diff --git a/MediaBrowser/MediaBrowser.swift b/MediaBrowser/MediaBrowser.swift index 333733a..33fa0ca 100755 --- a/MediaBrowser/MediaBrowser.swift +++ b/MediaBrowser/MediaBrowser.swift @@ -2028,26 +2028,23 @@ public class MediaBrowser: UIViewController, UIScrollViewDelegate, UIActionSheet //MARK: - Misc func doneButtonPressed(sender: AnyObject) { - // Only if we're modal and there's a done button - if doneButton != nil { - // See if we actually just want to show/hide grid - if enableGrid { - if startOnGrid && nil == gridController { - showGrid(animated: true) - return - } else if !startOnGrid && gridController != nil { - hideGrid() - return - } - } - - // Dismiss view controller - // Call delegate method and let them dismiss us - if let d = delegate { - d.mediaBrowserDidFinishModalPresentation(mediaBrowser: self) + // See if we actually just want to show/hide grid + if enableGrid { + if startOnGrid && nil == gridController { + showGrid(animated: true) + return + } else if !startOnGrid && gridController != nil { + hideGrid() + return } - // dismissViewControllerAnimated:true completion:nil] } + + // Dismiss view controller + // Call delegate method and let them dismiss us + if let d = delegate { + d.mediaBrowserDidFinishModalPresentation(mediaBrowser: self) + } + // dismissViewControllerAnimated:true completion:nil] } //MARK: - Actions