Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The difference between a view and its controller can be properly framed in the context of the <a href="http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller" rel="nofollow">Model-View-Controller pattern</a> (also have a look at <a href="http://www.codinghorror.com/blog/2008/05/understanding-model-view-controller.html" rel="nofollow">this post</a>):</p> <blockquote> <p>A view is a (visual) representation of its model. It would ordinarily highlight certain attributes of the model and suppress others. It is thus acting as a presentation filter.</p> <p>A view is attached to its model (or model part) and gets the data necessary for the presentation from the model by asking questions. It may also update the model by sending appropriate messages. All these questions and messages have to be in the terminology of the model, the view will therefore have to know the semantics of the attributes of the model it represents.</p> <p>A controller is the link between a user and the system. It provides the user with input by arranging for relevant views to present themselves in appropriate places on the screen. It provides means for user output by presenting the user with menus or other means of giving commands and data. The controller receives such user output, translates it into the appropriate messages and pass these messages on to one or more of the views.</p> </blockquote> <p>The idea is that the view is responsible for the visual representation of the data contained in the model; the controller is responsible for the user interaction and communication between the view and the model, roughly speaking.</p> <p>This applies to the relationship between <code>UIView</code> and <code>UIViewController</code>, as well as to the relationship between <code>UITableView</code> and <code>UITableViewController</code>, etc. Also to be noted that while <code>UIView</code>/<code>UIViewController</code> has no provision for a model class (since they are very broad classes, so the model could be anything), <code>UITableView</code>/<code>UITableViewController</code> do define a model in the form of the table data source and it <code>UITableViewDataSource</code>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload