I need the same type of table view controllers in my app many times and would like to create a more generic table view controller which I can use over and over again.
These table view controllers are quite simple and show only the contents of an array, put a check mark to the selected table view cell and return the index of the selected table view cell to the calling view controller after the Done button in the toolbar has been tapped.
Currently I create each one of these table view controllers directly in Storyboard and instantiate them by using segues.
Would it be possible to do this in code only (without using Storyboard or xibs)?
What would be the best way to instantiate and push them onto the navigation controller stack (each one will be shown in a view controller).

It’s trivial to do this in code. You create your view controller class just like you normally would (extend
UITableViewController). Implement all of the same table view data source and delegate methods. All of that is the same.When you want to use the table view controller you just do:
I would define your
MyTableViewControllerinitmethod like this:BTW – I have an app with over 100 view controllers in it and I’ve never used Interface builder or storyboards. It’s all code.