Defer ending a search until after the search-bar dismissal transition, to avoid a UIKit crash when the split view expands with search active. Fixes #5385.

This commit is contained in:
Brent Simmons committed 2026-08-05 09:42:10 -07:00
1 parent 00efcc2bcf
commit f8de09fc35
1 file changed
+3 -3
@@ -1100,14 +1100,14 @@ extension MainTimelineModernViewController: UISearchControllerDelegate {
}
func willDismissSearchController(_ searchController: UISearchController) {
coordinator?.endSearching()
searchController.searchBar.showsScopeBar = false
// Async to avoid an iOS 26 UINavigationBar crash during the search-bar dismissal transition.
// Async to avoid iOS 26 UINavigationBar crashes during the search-bar dismissal
// transition — endSearching() mutates the timeline and the navigation stack.
DispatchQueue.main.async {
self.coordinator?.endSearching()
self.updateToolbar()
}
}
}
extension MainTimelineModernViewController: UISearchResultsUpdating {