The left red controller is the main one.
From it turns out to transfer data to another red controller.
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { let mainStoryboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil) let firstVC = mainStoryboard.instantiateViewController(withIdentifier: "GroupsViewController") as! GroupsViewController firstVC.name = nameGroupArray[indexPath.row] self.navigationController?.pushViewController(firstVC, animated: true) } I do it by analogy with blue controllers, but I cannot switch from the left blue to the right blue controller:
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { let mainStoryboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil) let secondVC = mainStoryboard.instantiateViewController(withIdentifier: "DetailViewController") as! DetailViewController secondVC.image = imageArray[indexPath.row]! secondVC.name = nameArray[indexPath.row] self.navigationController?.pushViewController(secondVC, animated: true)} The data in both left controllers is collectionViewCell (if this is important).
What could be the error?