Nitesh Nitesh - 8 months ago 49
iOS Question

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.

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