I am using a UITableView to present a variety of viewControllers. Depending on which index is clicked, it will present a different view controller, which can then be dismis
One reason for this behavior could be that your table view code, and thus the code to start up your other view controllers, is not executed on the main thread. But all code related to UI must be executed on the main thread to work correctly.
Thus please ensure that the code runs on the main thread, e.g. by setting an appropriate break point.
At the end of didSelectRow
method, deselect it so that it's available for selection the next time.
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
.
.
.
tableView.deselectRow(at: indexPath, animated: false)
}