Is it just me, or does it seem like UITableView is a combination of controller and view? The delegate has both controller functionality (selection) and view functionality (cell height). I keep trying to use it as one or the other and you just can't do it.
Although, my view of MVC is that the model is just the data (pretty lightweight), the view just draws the things, and the controller handles user actions. So you could remove the view and do testing on the controller. This doesn't seem to be Apple's perspective, so maybe I just haven't figured out their perspective yet.
In iOS, sometimes the line between view and controller gets blurred.
UIViewController is part of UIKit. UIKit is a framework developed specifically for iOS as a high-level wrapper over OpenGL, for performance reasons as well as making touch screen based interfaces easier to implement.
This is why UIViewController has many view-related hooks in it. For example, the native view lifecycle flow includes a call to the method `viewDidLoad` on UIViewController - a controller method dedicated to view functionality and customization.
That said, the UITableViewDelegate seems to have the standard amount of view and controller commingling that's found throughout the common iOS frameworks, IMO.
Comments
Is it just me, or does it seem like UITableView is a combination of controller and view? The delegate has both controller functionality (selection) and view functionality (cell height). I keep trying to use it as one or the other and you just can't do it.
Although, my view of MVC is that the model is just the data (pretty lightweight), the view just draws the things, and the controller handles user actions. So you could remove the view and do testing on the controller. This doesn't seem to be Apple's perspective, so maybe I just haven't figured out their perspective yet.
In iOS, sometimes the line between view and controller gets blurred.
UIViewController is part of UIKit. UIKit is a framework developed specifically for iOS as a high-level wrapper over OpenGL, for performance reasons as well as making touch screen based interfaces easier to implement.
This is why UIViewController has many view-related hooks in it. For example, the native view lifecycle flow includes a call to the method `viewDidLoad` on UIViewController - a controller method dedicated to view functionality and customization.
That said, the UITableViewDelegate seems to have the standard amount of view and controller commingling that's found throughout the common iOS frameworks, IMO.