marinofaggiana преди 4 години
родител
ревизия
1a9887356f

+ 3 - 3
iOSClient/Main/Colleaction Common/NCCollectionCommon.swift

@@ -106,7 +106,7 @@ class NCCollectionCommon: NSObject, NCSelectDelegate {
         }
     }
 
-    func openSelectView(items: [Any]) {
+    func openSelectView(items: [Any], viewController: UIViewController) {
         
         let navigationController = UIStoryboard.init(name: "NCSelect", bundle: nil).instantiateInitialViewController() as! UINavigationController
         let topViewController = navigationController.topViewController as! NCSelect
@@ -162,7 +162,7 @@ class NCCollectionCommon: NSObject, NCSelectDelegate {
         navigationController.setViewControllers(listViewController, animated: false)
         navigationController.modalPresentationStyle = .formSheet
         
-        appDelegate.window.rootViewController?.present(navigationController, animated: true, completion: nil)
+        viewController.present(navigationController, animated: true, completion: nil)
     }
     
     @objc func openFileViewInFolder(serverUrl: String, fileName: String) {
@@ -294,7 +294,7 @@ class NCCollectionCommon: NSObject, NCSelectDelegate {
         let open = UIMenu(title: NSLocalizedString("_open_", comment: ""), image: UIImage(systemName: "arrow.up.square"), children: [openIn, openQuickLook])
         
         let moveCopy = UIAction(title: NSLocalizedString("_move_or_copy_", comment: ""), image: UIImage(systemName: "arrow.up.right.square")) { action in
-            NCCollectionCommon.shared.openSelectView(items: [metadata])
+            NCCollectionCommon.shared.openSelectView(items: [metadata], viewController: viewController)
         }
         
         let deleteConfirmFile = UIAction(title: titleDeleteConfirmFile, image: UIImage(systemName: "trash"), attributes: .destructive) { action in

+ 2 - 2
iOSClient/Main/Menu/NCCollectionViewCommon+Menu.swift

@@ -196,7 +196,7 @@ extension NCCollectionViewCommon {
                     title: NSLocalizedString("_move_or_copy_", comment: ""),
                     icon: UIImage(named: "move")!.image(color: NCBrandColor.shared.icon, size: 50),
                     action: { menuAction in
-                        NCCollectionCommon.shared.openSelectView(items: [metadata])
+                        NCCollectionCommon.shared.openSelectView(items: [metadata], viewController: self)
                     }
                 )
             )
@@ -393,7 +393,7 @@ extension NCCollectionViewCommon {
                         }
                     }
                     if meradatasSelect.count > 0 {
-                        NCCollectionCommon.shared.openSelectView(items: meradatasSelect)
+                        NCCollectionCommon.shared.openSelectView(items: meradatasSelect, viewController: self)
                     }
                     self.tapSelect(sender: self)
                 }

+ 1 - 1
iOSClient/Media/NCMedia.swift

@@ -330,7 +330,7 @@ class NCMedia: UIViewController, NCEmptyDataSetDelegate, NCSelectDelegate {
                             }
                         }
                         if meradatasSelect.count > 0 {
-                            NCCollectionCommon.shared.openSelectView(items: meradatasSelect)
+                            NCCollectionCommon.shared.openSelectView(items: meradatasSelect, viewController: self)
                         }
                         self.selectOcId.removeAll()
                     }