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!!
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With