4 ms·
Specifically UITableView is a bad example here, because UITableView relies heavily on the `UITableViewDelegate` and `UITableViewDataSource`. For that, though,
by lyinsteve 13y ago
Specifically UITableView is a bad example here, because UITableView relies heavily on the `UITableViewDelegate` and `UITableViewDataSource`.
For that, though, you should make a separate class for the TableViewModel, to keep that code out of your ViewControllers.
- shadesandcolour 13y agoWell, maybe. UITableViewDelegate and UITableViewDataSource don't have anything to do with the layout of that tableview. But let's say I have a bunch of labels, or textfields, or buttons or imageViews. All of those stock classes will do a pretty good job without subclassing, and for many applications, there's no need to subclass them. If you're doing your layout in code, where else does the layout code go other than the Viewcontroller that manages all those objects.