Skip to content

Commit

Permalink
Merge pull request #8 from hyperoslo/fix/protocol
Browse files Browse the repository at this point in the history
Added public protocol
  • Loading branch information
richardtop committed Aug 10, 2015
2 parents 6c96fdc + f520d5d commit f6e714b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Source/ImagePickerController.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import UIKit

protocol ImagePickerDelegate {
@objc
public protocol ImagePickerDelegate {

func wrapperDidPress(images: [UIImage])
func doneButtonDidPress(images: [UIImage])
optional func wrapperDidPress(images: [UIImage])
optional func doneButtonDidPress(images: [UIImage])
}

public class ImagePickerController: UIViewController {
Expand Down Expand Up @@ -51,11 +52,10 @@ public class ImagePickerController: UIViewController {
return controller
}()

public weak var delegate: ImagePickerDelegate?
var topSeparatorCenter: CGPoint!
var initialFrame: CGRect!
var delegate: ImagePickerDelegate?
var targetIndexPath: NSIndexPath!


public var doneButtonTitle: String? {
didSet {
Expand Down Expand Up @@ -144,15 +144,15 @@ extension ImagePickerController: BottomContainerViewDelegate {
}

func doneButtonDidPress() {
delegate?.doneButtonDidPress(galleryView.selectedImages.mutableCopy() as! [UIImage])
delegate?.doneButtonDidPress?(galleryView.selectedImages.mutableCopy() as! [UIImage])
}

func cancelButtonDidPress() {
dismissViewControllerAnimated(true, completion: nil)
}

func imageWrapperDidPress() {
delegate?.wrapperDidPress(galleryView.selectedImages.mutableCopy() as! [UIImage])
delegate?.wrapperDidPress?(galleryView.selectedImages.mutableCopy() as! [UIImage])
}
}

Expand Down

0 comments on commit f6e714b

Please sign in to comment.