- Condition: I have a custom TableViewCell and I do all things programmatically, no xibs.
- if I want to do a MVC(split the view and the action), To use a TableView or to use a Single TableViewController, which is better for the MVC design?
- As far as I know TableView is just a UI view, and TableViewController can contain some logic. Do that mean, if I want a strict MVC design, I need to use TableView and another object-c file to handle the logic of the TableView, TableViewCell.
I have searched this on stackoverflow, google, and do not have a specific answer or a good understanding.
UITableViewCell subclass can act as Model. It can contain views that you display in UIView.
Create a method inside UITableViewCell subclass that inits the data and inserts it in the subviews of current cell.
In “tableView cellForRowAtIndexPath” method you instantiate your CustomCell class.
UITableViewController is the same as you will create by yourself UIViewController and put UITableView in it. It was subclassed from UIViewController only for user’s convenience. And sets delegate and datasource without need from your side to set them.