Marino Faggiana 6 years ago
parent
commit
c8ced10033
2 changed files with 4 additions and 4 deletions
  1. 3 3
      iOSClient/Create/CCCreateCloud.swift
  2. 1 1
      iOSClient/Scan/ScanCollectionView.swift

+ 3 - 3
iOSClient/Create/CCCreateCloud.swift

@@ -72,7 +72,7 @@ class CreateMenuAdd: NSObject {
 #if DEBUG
         if #available(iOS 11.0, *) {
             actionSheet.addButton(withTitle: NSLocalizedString("_scans_document_", comment: ""), image: CCGraphics.changeThemingColorImage(UIImage(named: "scan"), multiplier:2, color: colorGray), backgroundColor: NCBrandColor.sharedInstance.backgroundView, height: 50.0, type: AHKActionSheetButtonType.default, handler: {(AHKActionSheet) -> Void in
-                NCCreateScanDocument.sharedInstance.openScannerDocument(viewController: appDelegate.activeMain)
+                NCCreateScanDocument.sharedInstance.openScannerDocument()
             })
         }
 #endif
@@ -933,10 +933,10 @@ class NCCreateScanDocument : NSObject, ImageScannerControllerDelegate {
     let appDelegate = UIApplication.shared.delegate as! AppDelegate
     
     @available(iOS 10, *)
-    func openScannerDocument(viewController: UIViewController) {
+    func openScannerDocument() {
         let scannerVC = ImageScannerController()
         scannerVC.imageScannerDelegate = self
-        viewController.present(scannerVC, animated: true, completion: nil)
+        appDelegate.window.rootViewController?.present(scannerVC, animated: true, completion: nil)
     }
     
     @available(iOS 10, *)

+ 1 - 1
iOSClient/Scan/ScanCollectionView.swift

@@ -99,7 +99,7 @@ class DragDropViewController: UIViewController {
     
     @IBAction func add(sender: UIButton) {
         
-        
+        NCCreateScanDocument.sharedInstance.openScannerDocument()
     }
     
     //MARK: Private Methods