Take the below code (called from any given view controller in a navigation stack).
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let vc = MyViewController()
present(vc, animated: true) {
self.navigationController?.popToRootViewController(animated: false)
}
}
Now, this works perfectly well and everything behaves as expected. However, I get the following warning.
Unbalanced calls to begin/end appearance transitions for <MyApp.MyViewController: 0x1044276d0>.
So, given the warning printed, is there a better way to have a user be at the root of a navigation stack when they dismiss a modal view controller presented from any given view controller in the navigation stack?