Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
enzevalos_iphone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
enzevalos
enzevalos_iphone
Commits
5c25c632
Commit
5c25c632
authored
Mar 26, 2021
by
Aylin
Browse files
Options
Downloads
Patches
Plain Diff
Figuring out the Navigation Link
parent
e2332adb
No related branches found
No related tags found
1 merge request
!79
Resolve "Add comments to: AttachmentViewMain.swift"
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
enzevalos_iphone/SwiftUI/Read/Tabbed Views/AttachmentsViewMain.swift
+51
-66
51 additions, 66 deletions
...phone/SwiftUI/Read/Tabbed Views/AttachmentsViewMain.swift
with
51 additions
and
66 deletions
enzevalos_iphone/SwiftUI/Read/Tabbed Views/AttachmentsViewMain.swift
+
51
−
66
View file @
5c25c632
...
...
@@ -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{
)
)
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment