1

I have an iOS app that uses GooglePlaces API. I use the "Add a Results Controller" technique to implement the search bar, but instead of assigning the searcher to the navigationItem.titleview like so:

navigationItem.titleView = searchController?.searchBar

I assign the searchController to the navigationItem.searchController like this:

navigationItem.searchController = searchController

This has worked for me up until iOS 12.4. I don't like the way it looks when the searcher is in the titleView.

Now in iOS 13.x this results in duplicated title text which can be seen in the attached images. iOS12

iOS 13

This duplicate appears when the search bar has been activated then Cancelled or when the focus moves to another control. When you pull down on the underlying table, you can see the duplicate in the live app.

It also causes the Search page title to bleed through when you navigate to the detail page. I don't know if this is a GooglePLaces API issue or an iOS 13 issue, but it causes my app to be rejected from the app store.

If anybody has seen this behavior please let me know. i have a sample project that shows the behavior.

Ferdinand Rios
  • 972
  • 6
  • 18

2 Answers2

1

I've been struggling with the very same issue. It's definitely a problem with UISearchController.

For now, what's known is:

  1. It can be avoided by setting searchController.hidesNavigationBarDuringPresentation to true (thanks to Chris' comment).

  2. If you absolutely must have searchController.hidesNavigationBarDuringPresentation to be set to false, you can manually remove offending labels as in this answer.

  3. Finally, it's been reported that iOS 13.2 fixes that bug.

For more details see this question.

P.S. It was so hard to find any info about that bug, so I decided to collect all available clues in one answer for all of those who's faced the same problem.

Arkadii
  • 1,028
  • 7
  • 9
0

This has been fixed with iOS 13.2

Ferdinand Rios
  • 972
  • 6
  • 18