Custom back button for NavigationView's navigation bar in SwiftUI : <p>I want to add a custom navigation button that will look somewhat like this:</p>

<p><a href="https://i.stack.imgur.com/OFgvK.png" rel="noreferrer"><img src="https://i.stack.imgur.com/OFgvK.png" alt="desired navigation back button"></a></p>

<p>Now, I've written a custom <code>BackButton</code> view for this. When applying that view as leading navigation bar item, by doing: </p>

<pre><code>.navigationBarItems(leading: BackButton())
</code></pre>

<p>...the navigation view looks like this:</p>

<p><a href="https://i.stack.imgur.com/3YZD9.png" rel="noreferrer"><img src="https://i.stack.imgur.com/3YZD9.png" alt="current navigation back button"></a></p>

<p>I've played around with modifiers like:</p>

<pre><code>.navigationBarItem(title: Text(""), titleDisplayMode: .automatic, hidesBackButton: true)
</code></pre>

<p>without any luck.</p>

<h2>Question</h2>

<p>How can I...</p>

<ol>
<li>set a view used as custom back button in the navigation bar? OR:</li>
<li>programmatically pop the view back to its parent?<br>
When going for this approach, I could hide the navigation bar altogether using <code>.navigationBarHidden(true)</code></li>
</ol>
