5

I implemented a searchController and added in navigationItem.

That's code:

var searchController = UISearchController(searchResultsController: nil)
searchController.obscuresBackgroundDuringPresentation = false

definesPresentationContext = true
searchController.searchResultsUpdater = self
searchController.searchBar.placeholder = NSLocalizedString("Search", comment: "")
searchController.hidesNavigationBarDuringPresentation = true

// Layout
searchController.searchBar.barTintColor = UIColor.groupTableViewBackground
navigationItem.searchController = searchController

When I click in searchBar to write something, this warning appears in console:

NameOfProject[9238:211033] +[CATransaction synchronize] called within transaction NameOfProject[9238:211033] +[CATransaction synchronize] called within transaction NameOfProject[9238:211033] +[CATransaction synchronize] called within transaction NameOfProject[9238:211033] +[CATransaction synchronize] called within transaction

Please, someone knows how to solve this?

Thanks in advance!!

Rafaela Lourenço
  • 1,126
  • 16
  • 33

1 Answers1

2

There exists a related post.

This post states that this behavior might be a bug on iOS side, because it also occurs in a minimal example containing just a single UIViewController which contains a UISearchController and is embedded in a UINavigationController (see comment of Upholder Of Truth).

DerGote
  • 181
  • 2
  • 5