Skip to content
Snippets Groups Projects
Commit 5c25c632 authored by Aylin's avatar Aylin
Browse files

Figuring out the Navigation Link

parent e2332adb
No related branches found
No related tags found
1 merge request!79Resolve "Add comments to: AttachmentViewMain.swift"
......@@ -159,7 +159,6 @@ struct AttPrev:View{
){
QLV/*TODO:
.allowsHitTesting(false).disabled(true)*/ //this should make the whole view scrollable averywhere not just on the title
}
}
// preview should resemble the look of A4 format
......@@ -168,39 +167,30 @@ struct AttPrev:View{
//a hidden NavigationLink to open the preview in fullscreen
// seems not to work currently
NavigationLink(destination: QuickLookView(name: self.attachment.myName, data: self.attachment.myData)
.navigationBarItems(trailing: shareButton), isActive: self.$isFullScreen){Text("loi")}.hidden()
}
.onAppear(perform: {
NavigationLink(
destination: QuickLookView(name: self.attachment.myName, data: self.attachment.myData)
.navigationBarItems(trailing: anyViewShareButton), isActive: self.$isFullScreen) {Text("loi")}.hidden()}
.onAppear(
perform: {
self.getDownloadedState()
//download all functionality
if self.shouldBeDownloaded {self.isDownloaded=true; self.download()}
})
}
)
// remove file from documents directory
.onDisappear(perform: {
.onDisappear(
perform: {
let filename = getDocumentsDirectory().appendingPathComponent(self.attachment.myName)
do {
try FileManager.default.removeItem(at: filename)
} catch let error as NSError {
print("Error: \(error)")
}
catch let error as NSError {print("Error: \(error)")}
self.isDownloaded = false
print("======== Attachment DISAPPEAR -> REMOVE FILES ========")
})
}
var shareButton: some View {
return Button(action:{
//popover the standart apple sharing stuff
/* if let coord = AppDelegate.getAppDelegate().readViewCoordinator {
coord.shareData(self.attachment.myData as NSData)
}*/
}){
Image(systemName: "square.and.arrow.up")
}
)
}
// an open button converted into an AnyView
......@@ -289,10 +279,5 @@ struct AttPrev:View{
)
)
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment