Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

+[CATransaction synchronize] called within transaction when search

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!!

like image 628
Rafaela Lourenço Avatar asked Oct 29 '22 13:10

Rafaela Lourenço


1 Answers

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).

like image 60
DerGote Avatar answered Nov 13 '22 01:11

DerGote