My question is mostly architectural. I am using a UITableViewController
to display a list of things. Nothing special, pretty standard. However, tableHeaderView
contains significant functionality. There are several targets, they come to life, and the screen changes depending on user interaction. I currently have a custom subclass of UIView
that handles most of the routing display and debug logic back through the delegate protocol to the UITableViewController
to execute.
As additional functions are added to tableHeaderView
it seems to me that my UITableViewController
getting a little cluttered and long. So, I wonder if it makes sense to create a subclass of UIViewContoller
and set its view
to tableHeaderView
my UITableViewController
? If this is done, I would be a little distracted from the problems and could place almost all the logic in my new "UIViewController". I assume that I still need to forward some communication through the delegate between the two viewControllers.
Does this make sense in terms of architecture? Or should I continue to use the existing UITableViewController
for all the logic?
** EDIT **
For example, does this code make sense if it is placed in my UITableViewController
- (void)addHeader { myCustomHeaderViewController *hvc = [[myCustomHeaderViewController alloc] init];
source share