marinofaggiana 4 년 전
부모
커밋
eb22691bb9

+ 1 - 1
Cartfile.resolved

@@ -18,7 +18,7 @@ github "malcommac/SwiftRichString" "3.7.2"
 github "marinofaggiana/KTVHTTPCache" "2.0.2"
 github "marinofaggiana/OpenSSL" "6c7cf839d9c74e5a0b92bbf343e1a33b6f56a277"
 github "marinofaggiana/TOPasscodeViewController" "0.0.7"
-github "nextcloud/ios-communication-library" "589d6ba734415afa5fa1e8a201d6664b58a0004a"
+github "nextcloud/ios-communication-library" "fdab3ea57e77cb4eb2dd5291c24042cbc0e2a224"
 github "rechsteiner/Parchment" "v2.4.0"
 github "scenee/FloatingPanel" "v1.7.6"
 github "tilltue/TLPhotoPicker" "2.0.12"

+ 1 - 1
iOSClient/Main/CCMain.m

@@ -891,7 +891,7 @@
         return;
     }
         
-    [[NCCommunication shared] searchLiteralWithServerUrl:appDelegate.urlBase depth:@"infinity" literal:_searchFileName showHiddenFiles:[CCUtility getShowHiddenFiles] customUserAgent:nil addCustomHeaders:nil user:appDelegate.user timeout:120 completionHandler:^(NSString *account, NSArray *files, NSInteger errorCode, NSString *errorDescription) {
+    [[NCCommunication shared] searchLiteralWithServerUrl:appDelegate.urlBase depth:@"infinity" literal:_searchFileName showHiddenFiles:[CCUtility getShowHiddenFiles] customUserAgent:nil addCustomHeaders:nil timeout:120 completionHandler:^(NSString *account, NSArray *files, NSInteger errorCode, NSString *errorDescription) {
         
          if (errorCode == 0 && [account isEqualToString:appDelegate.account] && files != nil) {
              

+ 31 - 4
iOSClient/Main/Collection/NCCollectionViewCommon.swift

@@ -120,6 +120,13 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
             registerForPreviewing(with: self, sourceView: view)
         }
         
+        // Long Press on CollectionView
+        let longPressedGesture = UILongPressGestureRecognizer(target: self, action: #selector(longPressCollecationView(gestureRecognizer:)))
+        longPressedGesture.minimumPressDuration = 0.5
+        longPressedGesture.delegate = self
+        longPressedGesture.delaysTouchesBegan = true
+        collectionView.addGestureRecognizer(longPressedGesture)
+        
         NotificationCenter.default.addObserver(self, selector: #selector(changeTheming), name: NSNotification.Name(rawValue: k_notificationCenter_changeTheming), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(reloadDataSource), name: NSNotification.Name(rawValue: k_notificationCenter_reloadDataSource), object: nil)
         
@@ -456,7 +463,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
         }
     }
         
-    // MARK: DZNEmpty
+    // MARK: - DZNEmpty
     
     func backgroundColor(forEmptyDataSet scrollView: UIScrollView) -> UIColor? {
         return NCBrandColor.sharedInstance.backgroundView
@@ -503,7 +510,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
         return true
     }
     
-    // MARK: SEARCH
+    // MARK: - SEARCH
     
     func updateSearchResults(for searchController: UISearchController) {
 
@@ -527,7 +534,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
         reloadDataSource()
     }
     
-    // MARK: TAP EVENT
+    // MARK: - TAP EVENT
     
     @objc func tapSelect(sender: Any) {
         
@@ -628,7 +635,27 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
     func longPressMoreGridItem(with objectId: String, namedButtonMore: String, gestureRecognizer: UILongPressGestureRecognizer) {
     }
     
-    // MARK: SEGUE
+    @objc func longPressCollecationView(gestureRecognizer: UILongPressGestureRecognizer) {
+        if gestureRecognizer.state != .began { return }
+    
+        self.becomeFirstResponder()
+        let pasteboard = UIPasteboard.general
+        let type = pasteboard.types
+        
+        print(type)
+        
+            
+//            if let recognizerView = recognizer.view, let recognizerSuperView = recognizerView.superview, pasteboard.hasImages {
+                
+//                UIMenuController.shared.menuItems = [UIMenuItem(title: "Paste", action: #selector(pasteImage))]
+//                UIMenuController.shared.setTargetRect(recognizerView.frame, in: recognizerSuperView)
+//                UIMenuController.shared.setMenuVisible(true, animated:true)
+//            }
+    }
+    
+    // MARK: - COPY/PASTE
+    
+    // MARK: - SEGUE
     
     @objc func segue(metadata: tableMetadata) {
         self.metadataPush = metadata

+ 2 - 2
iOSClient/Media/NCMedia.swift

@@ -719,7 +719,7 @@ extension NCMedia {
         let height = self.tabBarController?.tabBar.frame.size.height ?? 0
         NCUtility.shared.startActivityIndicator(view: self.view, bottom: height + 50)
 
-        NCCommunication.shared.searchMedia(path: mediaPath, lessDate: lessDate, greaterDate: greaterDate, elementDate: "d:getlastmodified/", limit: limit, showHiddenFiles: CCUtility.getShowHiddenFiles(), user: appDelegate.user, timeout: 120) { (account, files, errorCode, errorDescription) in
+        NCCommunication.shared.searchMedia(path: mediaPath, lessDate: lessDate, greaterDate: greaterDate, elementDate: "d:getlastmodified/", limit: limit, showHiddenFiles: CCUtility.getShowHiddenFiles(), timeout: 120) { (account, files, errorCode, errorDescription) in
             
             self.oldInProgress = false
             NCUtility.shared.stopActivityIndicator()
@@ -791,7 +791,7 @@ extension NCMedia {
                 }
             }
 
-            NCCommunication.shared.searchMedia(path: self.mediaPath, lessDate: lessDate, greaterDate: greaterDate, elementDate: "d:getlastmodified/", limit: limit, showHiddenFiles: CCUtility.getShowHiddenFiles(), user: self.appDelegate.user, timeout: 120) { (account, files, errorCode, errorDescription) in
+            NCCommunication.shared.searchMedia(path: self.mediaPath, lessDate: lessDate, greaterDate: greaterDate, elementDate: "d:getlastmodified/", limit: limit, showHiddenFiles: CCUtility.getShowHiddenFiles(), timeout: 120) { (account, files, errorCode, errorDescription) in
                 
                 self.newInProgress = false
                 

+ 1 - 1
iOSClient/Networking/NCNetworking.swift

@@ -778,7 +778,7 @@ import Queuer
     
     @objc func searchFiles(urlBase: String, user: String, literal: String, completion: @escaping (_ account: String, _ metadatas: [tableMetadata]?, _ errorCode: Int, _ errorDescription: String)->()) {
         
-        NCCommunication.shared.searchLiteral(serverUrl: urlBase, depth: "infinity", literal: literal, showHiddenFiles: CCUtility.getShowHiddenFiles(), user: user) { (account, files, errorCode, errorDescription) in
+        NCCommunication.shared.searchLiteral(serverUrl: urlBase, depth: "infinity", literal: literal, showHiddenFiles: CCUtility.getShowHiddenFiles()) { (account, files, errorCode, errorDescription) in
             
             if errorCode == 0  {