0

I have created a scroll bar with a list of folders created by the user like in the picture

Navigation Link

a simple navigation link navigates inside the folder.

in order to give the option to the user to delete the folder, on the navigation view label I put an IF that change the icon of the folder base if the editing mode is on or off.

my issue is, when I'm changing the icon setting the var isEditFolderModeON = true with a long press gesture.

all working fine, problem is since I put the long press gesture in the Navigation link label it stop to work.

any solution? where I can move the long pressure gesture,

thanks

 NavigationLink(destination: FolderViewAirport(fm: self.fm, dm: self.dm, folders: folder)
                            .onAppear(perform: {
                                self.fm.updateFolderData(dm: self.dm) {
                                }
                            })

                        ) {

                            if self.isEditFolderModeON {

                                FolderBarEdit( folder: folder)
                                    .onTapGesture {
                                        self.fm.delateFolderTouch(nameFolder: folder)
                                }
                            }
                            else if self.isEditFolderModeON == false {
                               FolderBar(folder: folder)
                                .onLongPressGesture {
                                    self.isEditFolderModeON = true

                                }
                            }
}

if I remove the .onLongPressGesture {} it works, but where I can put the self.isEditFolderModeON = true

Chris
  • 7,579
  • 3
  • 18
  • 38
Damiano Miazzi
  • 1,514
  • 1
  • 16
  • 38
  • Consider solution in this topic [How to perform an action after NavigationLink is tapped?](https://stackoverflow.com/a/58898046/12299030) – Asperi May 24 '20 at 16:13
  • please read and consider this https://stackoverflow.com/help/minimal-reproducible-example – Chris May 24 '20 at 16:57

0 Answers0