Section-Index titles view in UITableView overlaps UISearchBar scope buttons

I've just hit the following bug, it's still persent in iOS 9.1: https://openradar.appspot.com/16404307


Did anyone find a solution for this?


Here's a copy of its description:


Summary:

In a UITableView when the data source provides title for the section-iondex on the right of the table, the section-index titles view overlaps the scope buttons in the UISearchBar at the top.

Steps to Reproduce:
  1. Add a UITableView to the controller;
  2. Provide section index titles to the table view datasource (e.g. with [[UILocalizedIndexedCollation currentCollation] sectionTitles];)
  3. Add a UISearchBar with scope buttons enabled in the tableview header view ([_tableView setTableHeaderView:_searchBar];)
Expected Results:

The section index title view should not overlap the scope button of the search bar. The search bar scope buttons should resize (or the developer should actually be able to resize the UISearchBar frame, which is not able to do)

Actual Results:

The section index titles view overlaps the scope buttons of the UISearchBar


I recently updated some code that used UISearchDisplayController to use UISearchController. There were definitely some oddities related to the scope buttons. It worked best in the end by not using two view controllers; there is only the original view controller and it's also the search results controller. Also, setting self.definesPresentationContext = YES was needed. My UI shows and hides the scope button titles depending on whether the searchbar is active. showsScopeBar is initialized to NO and then set to YES in response to user events.


I'll say that this was twitchy and the scopeButtons looked wonky or not with very slight changes to the code.

Section-Index titles view in UITableView overlaps UISearchBar scope buttons
 
 
Q