I have a view that is presented via sheet and navigation link. How can I tell if a view was shown via a Sheet or NavigationLink so that I can update my NavBar buttons appropriately? Right now, I'm using an "isModal" bool. It works, but is far from elegant. Building the navbar in the presenting view doesn't seem like a good solution. Is there a better way? Basically the same as this question except using SwiftUI How to check if a view controller is presented modally or pushed on a navigation stack?
Asked
Active
Viewed 66 times
1
-
Would you provide your code? – Asperi Apr 22 '20 at 05:48
-
@Asperi It's this same question except using SwiftUI. https://stackoverflow.com/questions/23620276/how-to-check-if-a-view-controller-is-presented-modally-or-pushed-on-a-navigation?rq=1 – Eric Apr 22 '20 at 16:24