Created
November 4, 2023 23:14
-
-
Save iOSappssolutions/8607d1b316dab94da1d219e5efcf7d70 to your computer and use it in GitHub Desktop.
Tapping on Menu activates NavigationLink in visionOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ContentView: View { | |
var body: some View { | |
NavigationStack { | |
VStack { | |
NavigationLink(value: "1") { | |
HStack { | |
Text("Test menu") | |
Menu { | |
Button { | |
print("tapped button") | |
} label: { | |
Label("test", systemImage: "plus") | |
} | |
} label: { | |
Image(systemName: "ellipsis") | |
} | |
.contentShape(.circle) | |
} | |
} | |
} | |
.navigationDestination(for: String.self) { _ in | |
Text("Navigation triggered") | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment