Post

Replies

Boosts

Views

Activity

Reply to SwiftUI EditMode and NavigationLink
Solved the problem this way:     var body: some View {         NavigationView {             List {                 ForEach(store.themes) { theme in                         NavigationLink(destination: EmojiMemoryGameView(game: EmojiMemoryGame(theme))) {                             VStack {                                 Text(theme.name)                                 Text(theme.emojiSet.joined())                             }                         }.gesture(editMode == .active ? tapGesture : nil)                 }             }             .environment(\.editMode, $editMode)         }     }     var tapGesture: some Gesture  {         TapGesture().onEnded{             print("sucess")         }     } Now if edit mode is inactive navigation link works like it should. If edit modi is active I assign custom gesture to this navigation link and it's works fine.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’22