title: SwiftUI go back programmatically from representable to View
body: <p>I'm trying to setup a qr reader within a new swift ui app.</p>
  
  <p>I can get load the UIKit qr reader view with this line</p>
  
  <p><code>NavigationLink(destination: QRCodeScan()){Text("Scan QR")}</code></p>
  
  <p>This is my ViewControllerRepresentable</p>
  
  <pre><code>struct QRCodeScan: UIViewControllerRepresentable {
  
  func makeCoordinator() -&gt; Coordinator {
      Coordinator(self)
  }
  
  func makeUIViewController(context: Context) -&gt; ScannerViewController {
      let vc = ScannerViewController()
      vc.delegate = context.coordinator
      return vc
  }
  
  func updateUIViewController(_ vc: ScannerViewController, context: Context) {
  }
  
  class Coordinator: NSObject, QRCodeScannerDelegate {
      func codeDidFind(_ code: String) {
          print(code)
          //Go back to the last page, take 'code' with you
      }
  
      var parent: QRCodeScan
  
      init(_ parent: QRCodeScan) {
          self.parent = parent
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>At the line 'Go back to the last page...' I need to programmatically return to the page which sent the user to the qr scanner. The page loads with a navigation back button, I pretty much need to replicate this buttons behaviour to call when I need</p>
  
  <p>Any help/pointers appreciated</p>
  
  <p>tia</p>