Skip to content

Commit

Permalink
Merge branch 'master' into fix-swipe-dismiss
Browse files Browse the repository at this point in the history
  • Loading branch information
younatics authored Oct 24, 2017
2 parents 380d7e7 + f123b02 commit 17065d3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 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.4'
s.version = '1.0.3'
s.summary = 'A simple iOS photo and video browser with optional grid view, captions and selections written in Swift3.'

s.description = <<-DESCRIPTION
Expand Down
6 changes: 5 additions & 1 deletion MediaBrowser/MediaBrowser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1512,6 +1512,9 @@ public class MediaBrowser: UIViewController, UIScrollViewDelegate, UIActionSheet
if let gc = gridController {
if gc.selectionMode {
self.title = NSLocalizedString("Select Photos", comment: "")
if let ab = actionButton {
self.navigationItem.rightBarButtonItem = ab
}
} else {
let photosText: String

Expand Down Expand Up @@ -2056,7 +2059,8 @@ public class MediaBrowser: UIViewController, UIScrollViewDelegate, UIActionSheet
// If they have defined a delegate method then just message them
// Let delegate handle things
if let d = delegate {
d.actionButtonPressed(at: currentPageIndex, in: self)
d.actionButtonPressed(at: currentPageIndex, in: self, sender: sender)
return
}

// Show activity view controller
Expand Down
4 changes: 2 additions & 2 deletions MediaBrowser/MediaBrowserDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public protocol MediaBrowserDelegate: class {
- Parameter photoIndex: Int
- Parameter mediaBrowser: MediaBrowser
*/
func actionButtonPressed(at photoIndex: Int, in mediaBrowser: MediaBrowser)
func actionButtonPressed(at photoIndex: Int, in mediaBrowser: MediaBrowser, sender: Any?)


/**
Expand Down Expand Up @@ -114,7 +114,7 @@ public extension MediaBrowserDelegate {

func didDisplayMedia(at index: Int, in mediaBrowser: MediaBrowser) { }

func actionButtonPressed(at photoIndex: Int, in mediaBrowser: MediaBrowser) { }
func actionButtonPressed(at photoIndex: Int, in mediaBrowser: MediaBrowser, sender: Any? = nil) { }

func isMediaSelected(at index: Int, in mediaBrowser: MediaBrowser) -> Bool { return false }

Expand Down

0 comments on commit 17065d3

Please sign in to comment.