Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • I implemented this and I can't get the NavigationLink to display the Text. I placed a Print statement in Button(action so know that is getting triggered but still no joy. Commented Oct 7, 2019 at 17:47
  • A bit more investigation shows the issue to be EmptyView. If I change it to NavigationLink(destination: EditView(event: self.event), isActive: $showEditView) {Text("Edit")} it works, but obviously the whole idea of a context menu is I don't want a button shown all the time. Commented Oct 7, 2019 at 18:26
  • Where do you have the NavigationLink in the view hierarchy? EmptyView() has worked in every example I've used but maybe its dependent on where it lives? Commented Oct 7, 2019 at 18:30
  • I am adding it into the VStack the same as your example. The other point to note is that NavigationView is not supported on WatchOS so VStack is my top level within the View. Commented Oct 7, 2019 at 18:42
  • 1
    Great. I didn’t realize that EmptyView doesn’t work on watchOS. Nice tip about .hidden() Commented Oct 7, 2019 at 19:37