How to properly refresh a UINavigationBar?
<p>In relation to this question: <a href="https://stackoverflow.com/questions/39065349/how-to-change-back-button-text-from-within-the-child-view-controller">How to change Back button text from within the child view controller?</a> I am searching for a propery way to refresh the navigation bar after changing the back button title with <code>previousViewController.navigationItem.backBarButtonItem?.title = "New Title"</code>.</p>

<p>The (not so ideal?) solution from the linked question:</p>

<pre><code>if let navigationController = self.navigationController {
    navigationController.popViewControllerAnimated(false)
    navigationController.pushViewController(self, animated: false)
}
</code></pre>

<p><strong>Edit:</strong></p>

<p>Apparently changing the layer frame forces the navigation bar to refresh. Not a solution, but a less expensive(?) workaround I guess:</p>

<pre><code>if let navigationController = self.navigationController {
    navigationController.navigationBar.layer.frame.insetInPlace(dx: 0.1, dy: 0)
    navigationController.navigationBar.layer.frame.insetInPlace(dx: -0.1, dy: 0)
}
</code></pre>