Skip to content

Commit

Permalink
Made the swipe up and down gestures work even when not presenting mod…
Browse files Browse the repository at this point in the history
…ally
  • Loading branch information
Jack Rouleau committed Oct 23, 2017
1 parent f12805e commit 380d7e7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
2 changes: 1 addition & 1 deletion MediaBrowser.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
33 changes: 15 additions & 18 deletions MediaBrowser/MediaBrowser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 380d7e7

Please sign in to comment.