2

I have three views in my App: MenuViewModel -> MainActionsViewModel -> SummaryViewModel and I would like to after click Button 'Back to menu' in SummaryViewModel back to the MenuViewModel. I've tried something like this - in struct SummaryViewModel added:

@Environment(\.presentationMode) var presentationMode: Binding<PresentationMode>

and in Button action also added:

self.presentationMode.wrappedValue.dismiss()

but after on click this button I go back to MainActionsViewModel, not to MenuViewModel. Is in SwiftUI possible to close 2 or more Views?

newbieHere
  • 276
  • 2
  • 15
  • 1
    I assume you need `.isDetailLink(false)`... see, for example, here for details https://stackoverflow.com/a/59662275/12299030 – Asperi Aug 11 '20 at 19:16

0 Answers0