When I add a UISearchController to a UINavigationItem from an UINavigationController; it becomes white when the view loads and changes to the color specified when the user c
It looks like it is required to use the new UINavigationBarAppearance on iOS 13. Try to add this to your viewDidLoad:
let appearance = UINavigationBarAppearance()
appearance.backgroundColor = .systemRed
appearance.titleTextAttributes = [NSAttributedString.Key.foregroundColor : UIColor.white]
navigationItem.standardAppearance = appearance
navigationItem.scrollEdgeAppearance = appearance
You will probably also want to set the searchField backgroundColor:
let searchField = searchController.searchBar.searchTextField
searchField.backgroundColor = .systemBackground