title: SwiftUI: How to do additional work when clicking a NavigationLink?
body: <p>Right now I have a navigation link</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>NavigationView {
       NavigationLink(destination: AnotherView())) {
            Text("Click Here")
       }
  }
      .navigationBarTitle("SwiftUI")</code></pre>
  </div>
  </div>
  </p>
  
  <p>What I want to have happen is that when I click the navigation link, I want an object to instantiated and put into a database.</p>
  
  <p>My question, in other words, is: how do you perform work aside from just pushing the new view when using NavigationLink?</p>