Change arrow color for popover created from storyboard in Swift
<p>I'm trying to change the default popover arrow color for a popover defined as a storyboard segue (not built programmatically) from a button. The following picture shows the white default popover arrow:</p>

<p><a href="https://i.stack.imgur.com/wOh6z.png" rel="noreferrer"><img src="https://i.stack.imgur.com/wOh6z.png" alt="enter image description here"></a></p>

<p>When I add</p>

<pre><code>navigationController?.popoverPresentationController?.backgroundColor = myNavBarColor
</code></pre>

<p>to the <code>viewWillAppear</code> method of the <code>UIViewController</code> presented in the popover, the result is the following:</p>

<p><a href="https://i.stack.imgur.com/HTHxI.png" rel="noreferrer"><img src="https://i.stack.imgur.com/HTHxI.png" alt="enter image description here"></a></p>

<p>Defining a new <code>UIPopoverBackgroundView</code> class for the <code>UIPopoverPresentationController</code> during the <code>prepareForSegue</code> method of the main <code>UIViewController</code> is "too late".</p>

<p>I hope there'll be a simple fix (with the same storyboard segue as popover) for such a common issue.</p>