Collection view's last focused index path lost after reload data in tvOS
<p>In my tvOS app, I have a collection view where I've set its <code>remembersLastFocusedIndexPath</code> to <code>true</code>. As this is not enough to get this behaviour, I've also overridden a method in my <code>UIViewController</code> like this:</p>

<pre><code>override weak var preferredFocusedView: UIView? {
    return collectionView
}
</code></pre>

<p>This was working fine until I started reloading the collection view for some reasons. It does work if, being the collection view visible, I call <code>collectionView.reloadData()</code>.</p>

<p>This doesn't work, tho, if I do the reload when the collection view is not visible, for example, when I'm in a detail view after tapping one of the items. When I come back to the grid, the focused index path is not the one I tapped.</p>

<p>As a workaround, I'm managing this non-ideal scenario:</p>

<ol>
<li>As the reload is triggered by fresh data coming from my backend, I only call <code>collectionView.reloadData()</code> when the collection view is visible (because I know that the last focused index doesn't change here).</li>
<li>I call <code>collectionView.reloadData()</code> in <code>viewDidAppear(animated: Bool)</code> to have the latest content available when the user comes back.</li>
</ol>

<p>How can I do this properly? Thanks in advance.</p>