I have a simple app I am building. A list of items in 1 view controller with a table view and embedded navigation controller. When you select a row it brings you to the details screen (no problem).
Push from List View to List Item
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
performSegue(withIdentifier: "ListItemDetailsVC", sender: nil)
}
Pop back from list item to List View
@IBAction func backToInboxTapped(_ sender: Any) {
navigationController?.popToRootViewController(animated: true)
}
This works fine!
My issue is that I have another view controller (add item) that presents modally when add button is clicked. The idea is that when it saves it brings you to the list detail vc.
@IBAction func saveItem(_ sender: Any) {
performSegue(withIdentifier: "DetailsFromAdd", sender: nil)
}
Opening up the details view controller from the add new controller works fine but once I open the details view I want to be able to go back to the rootViewController. The button does not work anymore