I am dynamically creating 9 cells that will fit into a UICollectionView
. When tapped, each button will load a different view controller. As the cells are generated by data from an array, so I do not have the ability to set a segue
with an identifier
in Interface Builder.
I have been using this method: self.navigationController?.pushViewController(vc, animated: true)
, but I believe that it is not the most up-to-date way to transition to a different view controller.
The Questions:
- Should I create a segue for each dynamic cell programically, if so: how?
- Should I connect the one button in interface builder to a dummy view controller and switch out the destination view controller before the segue begins, if so: how would I switch out the destination view controller?
Interface Builder screenshot of setup: