title: How to Dismiss view from viewModel in SwiftUI?
body: <p>I have one view with MVVM architecture. in view on button click i am calling webService from viewModel class on success i want to dismiss view.</p>
  <p>my viewmodel is <code>ObservableObject</code></p>
  <p>i am moving to other screen using navigation and not using sheet</p>
  <p>I have tried this</p>
  <pre><code>@Environment(\.presentationMode) var presentationMode: Binding&lt;PresentationMode&gt;
  `self.presentationMode.wrappedValue.dismiss()`
  </code></pre>
  <p>in view but it will call before API call.</p>
  <p>is there any way to dismiss view once i receive API data in viewModel?</p>
  <p>Thank you for help</p>