Răsfoiți Sursa

Improvements quick look

marinofaggiana 4 ani în urmă
părinte
comite
ce591bd030

+ 5 - 3
iOSClient/Main/NCDetailViewController.swift

@@ -46,7 +46,7 @@ class NCDetailViewController: UIViewController {
     private var videoLayer: AVPlayerLayer?
     private var viewerImageViewControllerLongPressInProgress = false
     
-    private let viewerQuickLook = NCViewerQuickLook.init()
+    private var viewerQuickLook: NCViewerQuickLook?
 
     //MARK: -
 
@@ -487,7 +487,8 @@ class NCDetailViewController: UIViewController {
 
                     CCUtility.copyFile(atPath: CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView), toPath: fileNamePath)
 
-                    viewerQuickLook.quickLook(url: URL(fileURLWithPath: fileNamePath), viewController: self)
+                    viewerQuickLook = NCViewerQuickLook.init()
+                    viewerQuickLook?.quickLook(url: URL(fileURLWithPath: fileNamePath), viewController: self)
                     
                     DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
                         self.unload(checkWindow: false)
@@ -591,7 +592,8 @@ class NCDetailViewController: UIViewController {
 
         CCUtility.copyFile(atPath: CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView), toPath: fileNamePath)
 
-        viewerQuickLook.quickLook(url: URL(fileURLWithPath: fileNamePath), viewController: self)
+        viewerQuickLook = NCViewerQuickLook.init()
+        viewerQuickLook?.quickLook(url: URL(fileURLWithPath: fileNamePath), viewController: self)
         
         DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
             self.unload(checkWindow: false)

+ 4 - 2
iOSClient/Networking/NCNetworkingNotificationCenter.swift

@@ -37,6 +37,7 @@ import Foundation
     }()
     
     let appDelegate = UIApplication.shared.delegate as! AppDelegate
+    var viewerQuickLook: NCViewerQuickLook?
     
     //MARK: - Download
 
@@ -72,12 +73,13 @@ import Foundation
                     // Quick Look
                     if selector == selectorLoadFileQuickLook {
                         
-                        let quicklook = NCViewerQuickLook.init()
+                        
                         let fileNamePath = NSTemporaryDirectory() + metadata.fileNameView
 
                         CCUtility.copyFile(atPath: CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView), toPath: fileNamePath)
 
-                        quicklook.quickLook(url: URL(fileURLWithPath: fileNamePath), viewController: appDelegate.activeMain)
+                        viewerQuickLook = NCViewerQuickLook.init()
+                        viewerQuickLook?.quickLook(url: URL(fileURLWithPath: fileNamePath), viewController: appDelegate.activeMain)
                         return
                     }