I am using a table view with a specific number of rows that allows me to switch to other project screens, however when I change to another storyboard the navigation controller does not allow me to return.
my code is the following:
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)
{
switch indexPath.row {
case 0:
let storyboard = UIStoryboard(name: "Product", bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "ProductViewController") as UIViewController
present(vc, animated: true, completion: nil)
break
default: break
}
}
This allows me to see the view controller of the other storyboard, I would like to be able to keep the navigation controller.
I managed to do this via the storyboard reference, although I couldn't assign the changes depending on the cell touched.
Any ideas?
To continue using the navigation controller you should do a push by changing this line of code:
for this:
and if you want to see the changes in the destination viewController (I don't know if I understood correctly and if you meant that) in order to assign the changes according to the cells touched, the destination viewController , which in this case is vc , should have a property and simply assign it before doing the push. For example: