Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Sh1d0w/multi_image_picker
Browse files Browse the repository at this point in the history
  • Loading branch information
Sh1d0w committed Sep 9, 2020
2 parents 08f4fe9 + 98f48ee commit c9d1a96
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ios/Classes/SwiftMultiImagePickerPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public class SwiftMultiImagePickerPlugin: NSObject, FlutterPlugin {

let genericError = "500"

let vc = BSImagePickerViewController()

init(messenger: FlutterBinaryMessenger) {
self.messenger = messenger;
super.init();
Expand All @@ -61,7 +63,6 @@ public class SwiftMultiImagePickerPlugin: NSObject, FlutterPlugin {
return result(FlutterError(code: "PERMISSION_PERMANENTLY_DENIED", message: "The user has denied the gallery access.", details: nil))
}

let vc = BSImagePickerViewController()

if #available(iOS 13.0, *) {
// Disables iOS 13 swipe to dismiss - to force user to press cancel or done.
Expand Down Expand Up @@ -134,7 +135,7 @@ public class SwiftMultiImagePickerPlugin: NSObject, FlutterPlugin {
if let autoCloseOnSelectionLimit = options["autoCloseOnSelectionLimit"] {
if (!autoCloseOnSelectionLimit.isEmpty && autoCloseOnSelectionLimit == "true") {
if (maxImages == totalImagesSelected) {
UIApplication.shared.sendAction(vc.doneButton.action!, to: vc.doneButton.target, from: self, for: nil)
UIApplication.shared.sendAction(self.vc.doneButton.action!, to: self.vc.doneButton.target, from: self, for: nil)
}
}
}
Expand Down

0 comments on commit c9d1a96

Please sign in to comment.