Questions tagged [swiftui-ontapgesture]

49 questions
0
votes
2 answers

Swift UI @State does get set on the first tap

I have a simple list of for a Custom View. What needs to happen is when one of the items are selected it needs to show the detail view for that item. In my code, when I select an item for the very first time, the @Statet selectedListener does not…
Minon Weerasinghe
  • 312
  • 1
  • 3
  • 13
-1
votes
1 answer

How would I wrap the subtitle for the image url so that it leads to another screen?

I am trying to allow a user to click on a picture and allow them to get information about that image, how would I go about that? I was thinking about wrapping the subtitle(with the image url) in the gesture detector and I was getting some errors so…
-1
votes
2 answers

NavigationLink open destination without isActive enabled

I have a NavigationLink with a simple text. Should open a secret logged-in page if determinated conditions are verified. But I noticed that I can bypass the "isActive" with two simple tricks: long press on text and release, Secret view…
elp
  • 8,021
  • 7
  • 61
  • 120
-2
votes
1 answer

Result of 'NavigationLink' initializer is unused

import SwiftUI struct ListView: View { @EnvironmentObject var listViewModel: ListViewModel @State var isTitleEdited: Bool = false var body: some View { ZStack { if listViewModel.items.isEmpty { …
1 2 3
4