I want to show no scope bar when the table is empty (before the search bar edits for the first time), no scope bar when it\'s editing, and finally show it when editing done. I k
For the newer iOS versions (tested on 11-13), you don't have to implement any delegate methods for this to work.
In iOS 13 the default behaviour is to always show the scope bar, even when search is not active. Previous iOS versions automatically show and hide the scope bar when search is active.
You need to add this in viewDidLoad()
if #available(iOS 13.0, *) {
searchController.automaticallyShowsScopeBar = true
}