Search code examples
uicoloruisearchcontrollerios13uinavigationitemsearchbar

How to change NavController's Backbutton-tintColor in Combination with SearchController in iOS13


As for iOS13.0 and iOS13.1, I can see a difference in behaviour when using a SearchController:

-> in iOS12.x, the BackButton is correct in Yellow

-> in iOS13.0, the BackButton is correct in Yellow

-> in iOS13.1, the BackButton is wrong (in default-Blue)

The backButton turns into the wrong color if the user types a few Search-Letters and then presses Cancel.

In addition, I set the color as follows (..not working for iOS13.1):

navigationItem.searchController?.searchBar.barStyle = .black
navigationItem.searchController?.searchBar.keyboardAppearance = .dark
navigationItem.searchController?.searchBar.tintColor = .yellow
navigationItem.searchController?.searchBar.barTintColor = .yellow

enter image description here

enter image description here


Solution

  • I experienced this exact issue as well and it has been fixed on iOS 13.2