I have a UITableView that presents a timeline of data on tvOS. It is dynamically updated via an NSFetchedResultsController.
When the table is updated, new cells are added at the top. However: the previously selected cell remains focused, but the behaviour I need is for the focus to shift to the 'newest' (i.e. topmost) cell after the data update.
How can I achieve this?
Not sure what your code looks like, but you can create a property to keep track of whether the table is actively updating.
You can use this to determine if you want the normal focus before or to return the first row of your table view:
Then in your
NSFetchedResultsControllerDelegateset if it's updating or not:You can find more information here on how to update focus programmatically.