Browse Source

add ViewerQuickLook

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 years ago
parent
commit
f27931e961

+ 2 - 1
iOSClient/Main/Create cloud/NCUploadAssets.swift

@@ -97,6 +97,7 @@ struct UploadAssetsView: View {
     @State private var isPresentedQuickLook = false
     @State private var fileNamePath = NSTemporaryDirectory() + "Photo.jpg"
     @State private var metadata: tableMetadata?
+    @State private var timer = DispatchSource.makeTimerSource(queue: .main)
 
     var gridItems: [GridItem] = [GridItem()]
 
@@ -267,7 +268,7 @@ struct UploadAssetsView: View {
                                             .onTapGesture {
                                                 presentedQuickLook(uploadAssets.previewStore[index].image)
                                             }.fullScreenCover(isPresented: $isPresentedQuickLook) {
-                                                ViewerQuickLook(url: URL(fileURLWithPath: fileNamePath))
+                                                ViewerQuickLook(url: URL(fileURLWithPath: fileNamePath), isPresentedQuickLook: $isPresentedQuickLook, previewStore: $uploadAssets.previewStore[index], timer: $timer)
                                                     .ignoresSafeArea()
                                             }
                                     }

+ 3 - 3
iOSClient/Viewer/NCViewerQuickLook/ViewerQuickLook.swift

@@ -13,10 +13,10 @@ import Mantis
 struct ViewerQuickLook: UIViewControllerRepresentable {
 
     let url: URL
-    //var timer: DispatchSourceTimer = DispatchSource.makeTimerSource(queue: .main)
 
-    // @Binding var isPresentedQuickLook: Bool
-    // @Binding var previewStore: PreviewStore
+    @Binding var isPresentedQuickLook: Bool
+    @Binding var previewStore: PreviewStore
+    @Binding var timer: DispatchSourceTimer
 
     func makeUIViewController(context: Context) -> UINavigationController {
         let controller = QLPreviewController()