Skip to content

Commit

Permalink
Merge pull request #16 from Jack-Rouleau/fix-swipe-dismiss
Browse files Browse the repository at this point in the history
Made the swipe up and down gestures work even when not presenting mod…
  • Loading branch information
younatics authored Oct 24, 2017
2 parents f123b02 + 17065d3 commit 14a79ef
Showing 1 changed file with 15 additions and 18 deletions.
33 changes: 15 additions & 18 deletions MediaBrowser/MediaBrowser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2031,26 +2031,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 14a79ef

Please sign in to comment.