I have a view controller with a table view containing a list of chats, a search controller included in the navigation element (iOS 11 function)
let searchController = UISearchController(searchResultsController: nil) searchController.dimsBackgroundDuringPresentation = false navigationItem.searchController = searchController definesPresentationContext = true
When a user selects a chat in a table view, the application launches a new view controller with another table view containing messages for that chat. This works as expected:

The problem is that when the user activates the search controller, I find some chat and dials it, then the moved view controller containing a table view with chat messages really causes a strange animation with a table view that should not happen

I load the data before the actual navigation and bind it to the table view in viewDidLoad , using only reload() in the table view. The problem table view uses auto-layout and custom cells.
The problem is very similar to the UITableView has unwanted animation when calling reloadData , but for me it only happens when the active iOS 11 search controller is active.
Change If I remove tableView.rowHeight = UITableViewAutomaticDimension and use fixed height with func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat , the problem still exists
ios uitableview autolayout swift ios11
Igor Kulman
source share