Mac Catalyst: UISearchController with UITableView Randomly Moves the Scroll Position after Swipe Action

I have a UISearchController. It uses a search results controller (the search results controller uses a UITableView). If I select a row.. scroll a bit, deactivate the window then reactivate the window the scroll position starts flying. Usually this random scroll exposes the selected row but sometimes it scroll elsewhere.

I subclassed UITableView to try to figure out what's causing this random scrolling. I have a breakpoint in -scrollRectToVisible:scrollRectToVisible:

-(void)scrollRectToVisible:(CGRect)rect animated:(BOOL)animated

{
    [super scrollRectToVisible:rect animated:animated]; //<--Break point here
}

And was able to determine that its coming from UIFocusSystem/UISearchController:

#1 0x00000001d65d748c in -[UISearchController _willUpdateFocusInContext:withAnimationCoordinator:] ()

#2 0x00000001d611fdd0 in __85-[UIFocusSystem _sendWillUpdateFocusNotificationsInContext:withAnimationCoordinator:]_block_invoke ()

#3 0x00000001d60d4944 in _UIFocusEnvironmentEnumerateAncestorEnvironments ()

#4 0x00000001d6120480 in -[UIFocusSystem _sendNotificationsForFocusUpdateInContext:withAnimationCoordinator:usingBlock:] ()

#5 0x00000001d611faf8 in -[UIFocusSystem _sendWillUpdateFocusNotificationsInContext:withAnimationCoordinator:] ()

#6 0x00000001d611f42c in -[UIFocusSystem _updateFocusWithContext:report:] () #7 0x00000001d611b90c in -[UIFocusSystem _setEnabled:withAnimationCoordinator:] ()

#8 0x00000001d61a1128 in __49-[_UIFocusSystemSceneComponent _setupFocusSystem]_block_invoke ()

#9 0x00000001d618ccac in -[_UIFocusStateObserver notifyObserversIfNecessary] ()

--

Workarounds/input always appreciated.

Mac Catalyst: UISearchController with UITableView Randomly Moves the Scroll Position after Swipe Action
 
 
Q