If you select a file in the Files app on iOS you can tap on the title and get some extra actions, similar to a context menu. I want this in one of my apps and learned about the toolbarTitleMenu
modifier. However if I add a ShareLink
and tap on it, nothing happens.
Here's an example:
struct ContentView: View {
var body: some View {
NavigationStack {
Text("Example Content")
.toolbarTitleMenu {
ShareLink(item: "test share content") // Here, nothing happens
}
.navigationTitle("Test Title")
.navigationBarTitleDisplayMode(.inline)
ShareLink(item: "test share content") // Here it works
}
}
}
What am I doing wrong?
iOS 17.2.1