Search code examples
iosswiftuisearchcontroller

GET String of UISearchController's scopeButtonTitles


Is it possible to get string of UISearchContoller's segment controls ?

We get index path of that in this way

searchController.searchBar.selectedScopeButtonIndex

But instead of indexPath, I want to get the String.


Solution

  • searchController.searchBar.scopeButtonTitles![searchController.searchBar.selectedScopeButtonIndex]